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.
Auto Trait Implementations§
impl Freeze for BufferBuilder
impl RefUnwindSafe for BufferBuilder
impl Send for BufferBuilder
impl Sync for BufferBuilder
impl Unpin for BufferBuilder
impl UnwindSafe for BufferBuilder
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