BufferForDraw

Trait BufferForDraw 

Source
pub trait BufferForDraw<T>: Debug + Clone
where T: BufferVecItem,
{ // Required methods fn get_vk_buffer(&self) -> VkBuffer; fn len(&self) -> usize; fn convert_to_buffer_vec(self) -> BufferVec<T>; fn convert_to_buffer_with_type(self) -> BufferWithType<T>; // Provided methods fn flush(&mut self, _cmdbuf: VkCommandBuffer) -> Result<(), VulkanError> { ... } fn discard_staging_buffer(&mut self) { ... } fn is_empty(&self) -> bool { ... } }
Expand description

The trait for the mesh to hold buffers

Required Methods§

Source

fn get_vk_buffer(&self) -> VkBuffer

Must be able to get the VkBuffer handle

Source

fn len(&self) -> usize

Get the number of the items in the buffer

Source

fn convert_to_buffer_vec(self) -> BufferVec<T>

Convert to BufferVec<T>

Source

fn convert_to_buffer_with_type(self) -> BufferWithType<T>

Convert to BufferWithType<T>

Provided Methods§

Source

fn flush(&mut self, _cmdbuf: VkCommandBuffer) -> Result<(), VulkanError>

Flush staging buffer data to GPU

Source

fn discard_staging_buffer(&mut self)

Discard staging buffer if the buffer’s staging buffer is discardable

Source

fn is_empty(&self) -> bool

Check if the buffer is empty

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§