diff --git a/vulkano/src/buffer/cpu_access.rs b/vulkano/src/buffer/cpu_access.rs index ad215f0d..d3f67411 100644 --- a/vulkano/src/buffer/cpu_access.rs +++ b/vulkano/src/buffer/cpu_access.rs @@ -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 Buffer for Arc> } } +unsafe impl TypedBuffer for Arc> + where T: 'static + Send + Sync, A: MemoryPool +{ + type Content = T; +} + unsafe impl BufferAccess for CpuAccessibleBuffer where T: 'static + Send + Sync, A: MemoryPool { diff --git a/vulkano/src/buffer/cpu_pool.rs b/vulkano/src/buffer/cpu_pool.rs index 5288fb34..e643b0e5 100644 --- a/vulkano/src/buffer/cpu_pool.rs +++ b/vulkano/src/buffer/cpu_pool.rs @@ -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 Buffer for CpuBufferPoolSubbuffer } } +unsafe impl TypedBuffer for CpuBufferPoolSubbuffer + where A: MemoryPool, T: 'static +{ + type Content = T; +} + impl Clone for CpuBufferPoolSubbuffer where A: MemoryPool { fn clone(&self) -> CpuBufferPoolSubbuffer { let old_val = self.buffer.subbuffers[self.subbuffer_index].num_cpu_accesses.fetch_add(1, Ordering::SeqCst); diff --git a/vulkano/src/buffer/device_local.rs b/vulkano/src/buffer/device_local.rs index bc47be9e..7a85fb0e 100644 --- a/vulkano/src/buffer/device_local.rs +++ b/vulkano/src/buffer/device_local.rs @@ -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 Buffer for Arc> } } +unsafe impl TypedBuffer for Arc> + where T: 'static + Send + Sync, + A: MemoryPool +{ + type Content = T; +} + unsafe impl BufferAccess for DeviceLocalBufferAccess

where P: SafeDeref>, T: 'static + Send + Sync, diff --git a/vulkano/src/buffer/immutable.rs b/vulkano/src/buffer/immutable.rs index 6be0b41f..6f42cdb1 100644 --- a/vulkano/src/buffer/immutable.rs +++ b/vulkano/src/buffer/immutable.rs @@ -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 Buffer for Arc> } } +unsafe impl TypedBuffer for Arc> + where T: 'static + Send + Sync, A: MemoryPool +{ + type Content = T; +} + unsafe impl BufferAccess for ImmutableBuffer where T: 'static + Send + Sync, A: MemoryPool {