pub struct GpuBuffer<'a> {
pub label: &'static str,
pub layout: BufferLayout,
pub bytes: Cow<'a, [u8]>,
}Expand description
Bytes ready to upload, with their layout.
bytes is little-endian, matching every GPU and wasm32. It borrows when
the source column is already laid out correctly (see
GpuBuffer::from_column) and owns an interleaved copy otherwise.
Fields§
§label: &'static strDebug label, suitable for a GPU buffer label.
layout: BufferLayoutMemory layout of bytes.
bytes: Cow<'a, [u8]>Buffer contents; bytes.len() == layout.byte_len().
Implementations§
Source§impl<'a> GpuBuffer<'a>
impl<'a> GpuBuffer<'a>
Sourcepub fn from_column(column: Column<'a>) -> Result<Self, BoundaryError>
pub fn from_column(column: Column<'a>) -> Result<Self, BoundaryError>
Wrap a scalar column as a one-component buffer; zero-copy on little-endian targets.
Columns obtained from TopologyColumns or
FrameColumns are already bounded, so this only
fails for hand-built columns longer than u32::MAX rows.
Trait Implementations§
impl<'a> StructuralPartialEq for GpuBuffer<'a>
Auto Trait Implementations§
impl<'a> Freeze for GpuBuffer<'a>
impl<'a> RefUnwindSafe for GpuBuffer<'a>
impl<'a> Send for GpuBuffer<'a>
impl<'a> Sync for GpuBuffer<'a>
impl<'a> Unpin for GpuBuffer<'a>
impl<'a> UnsafeUnpin for GpuBuffer<'a>
impl<'a> UnwindSafe for GpuBuffer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more