mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-23 15:24:25 +00:00
Move len() from TypedBuffer to Buffer
This commit is contained in:
parent
7d27103c15
commit
4990d78c12
@ -30,6 +30,11 @@ pub unsafe trait Buffer {
|
||||
self.inner().buffer.size()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn len(&self) -> usize where Self: TypedBuffer, Self::Content: Content {
|
||||
self.size() / <Self::Content as Content>::indiv_size()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn as_buffer_slice(&self) -> BufferSlice<Self::Content, &Self> where Self: Sized + TypedBuffer {
|
||||
BufferSlice::from(self)
|
||||
@ -193,11 +198,6 @@ unsafe impl<'a, B: ?Sized, S> TrackedBuffer<S> for &'a B where B: TrackedBuffer<
|
||||
|
||||
pub unsafe trait TypedBuffer: Buffer {
|
||||
type Content: ?Sized + 'static;
|
||||
|
||||
#[inline]
|
||||
fn len(&self) -> usize where Self::Content: Content {
|
||||
self.size() / <Self::Content as Content>::indiv_size()
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<B: ?Sized> TypedBuffer for Arc<B> where B: TypedBuffer {
|
||||
|
Loading…
Reference in New Issue
Block a user