mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-23 15:24:25 +00:00
Implement TypedBuffer everywhere
This commit is contained in:
parent
329f4da90e
commit
ddd666e087
@ -35,6 +35,7 @@ use buffer::sys::Usage;
|
||||
use buffer::traits::BufferAccess;
|
||||
use buffer::traits::BufferInner;
|
||||
use buffer::traits::Buffer;
|
||||
use buffer::traits::TypedBuffer;
|
||||
use buffer::traits::TypedBufferAccess;
|
||||
use device::Device;
|
||||
use device::DeviceOwned;
|
||||
@ -301,6 +302,12 @@ unsafe impl<T: ?Sized, A> Buffer for Arc<CpuAccessibleBuffer<T, A>>
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: ?Sized, A> TypedBuffer for Arc<CpuAccessibleBuffer<T, A>>
|
||||
where T: 'static + Send + Sync, A: MemoryPool
|
||||
{
|
||||
type Content = T;
|
||||
}
|
||||
|
||||
unsafe impl<T: ?Sized, A> BufferAccess for CpuAccessibleBuffer<T, A>
|
||||
where T: 'static + Send + Sync, A: MemoryPool
|
||||
{
|
||||
|
@ -25,6 +25,7 @@ use buffer::sys::Usage;
|
||||
use buffer::traits::BufferAccess;
|
||||
use buffer::traits::BufferInner;
|
||||
use buffer::traits::Buffer;
|
||||
use buffer::traits::TypedBuffer;
|
||||
use buffer::traits::TypedBufferAccess;
|
||||
use device::Device;
|
||||
use device::DeviceOwned;
|
||||
@ -392,6 +393,12 @@ unsafe impl<T: ?Sized, A> Buffer for CpuBufferPoolSubbuffer<T, A>
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: ?Sized, A> TypedBuffer for CpuBufferPoolSubbuffer<T, A>
|
||||
where A: MemoryPool, T: 'static
|
||||
{
|
||||
type Content = T;
|
||||
}
|
||||
|
||||
impl<T: ?Sized, A> Clone for CpuBufferPoolSubbuffer<T, A> where A: MemoryPool {
|
||||
fn clone(&self) -> CpuBufferPoolSubbuffer<T, A> {
|
||||
let old_val = self.buffer.subbuffers[self.subbuffer_index].num_cpu_accesses.fetch_add(1, Ordering::SeqCst);
|
||||
|
@ -27,6 +27,7 @@ use buffer::sys::Usage;
|
||||
use buffer::traits::BufferAccess;
|
||||
use buffer::traits::BufferInner;
|
||||
use buffer::traits::Buffer;
|
||||
use buffer::traits::TypedBuffer;
|
||||
use buffer::traits::TypedBufferAccess;
|
||||
use device::Device;
|
||||
use device::DeviceOwned;
|
||||
@ -178,6 +179,13 @@ unsafe impl<T: ?Sized, A> Buffer for Arc<DeviceLocalBuffer<T, A>>
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: ?Sized, A> TypedBuffer for Arc<DeviceLocalBuffer<T, A>>
|
||||
where T: 'static + Send + Sync,
|
||||
A: MemoryPool
|
||||
{
|
||||
type Content = T;
|
||||
}
|
||||
|
||||
unsafe impl<P, T: ?Sized, A> BufferAccess for DeviceLocalBufferAccess<P>
|
||||
where P: SafeDeref<Target = DeviceLocalBuffer<T, A>>,
|
||||
T: 'static + Send + Sync,
|
||||
|
@ -31,6 +31,7 @@ use buffer::sys::Usage;
|
||||
use buffer::traits::BufferAccess;
|
||||
use buffer::traits::BufferInner;
|
||||
use buffer::traits::Buffer;
|
||||
use buffer::traits::TypedBuffer;
|
||||
use buffer::traits::TypedBufferAccess;
|
||||
use device::Device;
|
||||
use device::DeviceOwned;
|
||||
@ -172,6 +173,12 @@ unsafe impl<T: ?Sized, A> Buffer for Arc<ImmutableBuffer<T, A>>
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: ?Sized, A> TypedBuffer for Arc<ImmutableBuffer<T, A>>
|
||||
where T: 'static + Send + Sync, A: MemoryPool
|
||||
{
|
||||
type Content = T;
|
||||
}
|
||||
|
||||
unsafe impl<T: ?Sized, A> BufferAccess for ImmutableBuffer<T, A>
|
||||
where T: 'static + Send + Sync, A: MemoryPool
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user