Struct lambda_platform::gfx::buffer::BufferBuilder
source · pub struct BufferBuilder { /* private fields */ }
Implementations§
source§impl BufferBuilder
impl BufferBuilder
pub fn new() -> Self
pub fn with_length(&mut self, length: usize) -> &mut Self
pub fn with_usage(&mut self, usage: Usage) -> &mut Self
pub fn with_properties(&mut self, properties: Properties) -> &mut Self
pub fn with_buffer_type(&mut self, buffer_type: BufferType) -> &mut Self
sourcepub fn build<RenderBackend: Backend, Data: Sized>(
&self,
gpu: &mut Gpu<RenderBackend>,
data: Vec<Data>
) -> Result<Buffer<RenderBackend>, &'static str>
pub fn build<RenderBackend: Backend, Data: Sized>(
&self,
gpu: &mut Gpu<RenderBackend>,
data: Vec<Data>
) -> Result<Buffer<RenderBackend>, &'static str>
Builds & binds a buffer of memory to the GPU. If the buffer cannot be bound to the GPU, the buffer memory is freed before the error is returned. Data must represent the data that will be stored in the buffer, meaning it must repr C and be the same size as the buffer length.