[−][src]Struct golem::Buffer
A collection of values stored contiguously on the GPU, as either a VertexBuffer
or an
ElementBuffer
Buffers serve as input to draw calls
, by passing the input to the ShaderProgram
Methods
impl Buffer<f32>
[src]
pub fn new(ctx: &Context) -> Result<Self, GolemError>
[src]
Create a VertexBuffer
to store the vertex values
impl Buffer<u32>
[src]
pub fn new(ctx: &Context) -> Result<Self, GolemError>
[src]
Create a ElementBuffer
to store the index values
impl<T: Pod> Buffer<T>
[src]
pub fn size(&self) -> usize
[src]
The current capacity of the buffer in bytes
pub fn set_data(&mut self, data: &[T])
[src]
Set the data this buffer holds, resizing it if necessary
The conditions under which the buffer is reallocated are an implementation detail, and it's best not to rely on them.
pub fn set_sub_data(&self, start: usize, data: &[T])
[src]
Set some range of the buffer, within the existing capacity
The range (the start to the end of the data) must fall within the existing buffer's capacity, or this method will panic.
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for Buffer<T>
impl<T> !Send for Buffer<T>
impl<T> !Sync for Buffer<T>
impl<T> Unpin for Buffer<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for Buffer<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,