mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-23 23:35:54 +00:00
Add Buffer::size()
This commit is contained in:
parent
3ae8d75405
commit
9a114a03b7
@ -294,6 +294,11 @@ unsafe impl<T: ?Sized, A> Buffer for Arc<CpuAccessibleBuffer<T, A>>
|
||||
fn access(self) -> Self {
|
||||
self
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn size(&self) -> usize {
|
||||
self.inner.size()
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: ?Sized, A> BufferAccess for CpuAccessibleBuffer<T, A>
|
||||
|
@ -385,6 +385,11 @@ unsafe impl<T: ?Sized, A> Buffer for CpuBufferPoolSubbuffer<T, A>
|
||||
fn access(self) -> Self {
|
||||
self
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn size(&self) -> usize {
|
||||
self.size
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: ?Sized, A> Clone for CpuBufferPoolSubbuffer<T, A> where A: MemoryPool {
|
||||
|
@ -171,6 +171,11 @@ unsafe impl<T: ?Sized, A> Buffer for Arc<DeviceLocalBuffer<T, A>>
|
||||
fn access(self) -> Self::Access {
|
||||
DeviceLocalBufferAccess(self)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn size(&self) -> usize {
|
||||
self.inner.size()
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<P, T: ?Sized, A> BufferAccess for DeviceLocalBufferAccess<P>
|
||||
|
@ -165,6 +165,11 @@ unsafe impl<T: ?Sized, A> Buffer for Arc<ImmutableBuffer<T, A>>
|
||||
fn access(self) -> Self {
|
||||
self
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn size(&self) -> usize {
|
||||
self.inner.size()
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: ?Sized, A> BufferAccess for ImmutableBuffer<T, A>
|
||||
|
@ -168,6 +168,11 @@ unsafe impl<T: ?Sized, B> Buffer for BufferSlice<T, B> where B: BufferAccess {
|
||||
fn access(self) -> Self {
|
||||
self
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn size(&self) -> usize {
|
||||
self.size
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: ?Sized, B> BufferAccess for BufferSlice<T, B> where B: BufferAccess {
|
||||
|
@ -26,6 +26,9 @@ pub unsafe trait Buffer {
|
||||
|
||||
/// Builds an object that represents a GPU access to the buffer.
|
||||
fn access(self) -> Self::Access;
|
||||
|
||||
/// Returns the size of the buffer in bytes.
|
||||
fn size(&self) -> usize;
|
||||
}
|
||||
|
||||
/// Trait for objects that represent a way for the GPU to have access to a buffer or a slice of a
|
||||
|
Loading…
Reference in New Issue
Block a user