pub trait GenericMesh:
Debug
+ Any
+ Send
+ Sync {
Show 32 methods
// Required methods
fn clone(&self) -> Box<dyn GenericMesh>;
fn get_vk_vertex_buffer(&self) -> VkBuffer;
fn get_vk_index_buffer(&self) -> Option<VkBuffer>;
fn get_vk_instance_buffer(&self) -> Option<VkBuffer>;
fn get_vk_command_buffer(&self) -> Option<VkBuffer>;
fn create_index_buffer(
&mut self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>;
fn create_instance_buffer(
&mut self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>;
fn create_command_buffer(
&mut self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>;
fn set_vertex_buffer_data(
&self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>;
fn set_index_buffer_data(
&mut self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>;
fn set_instance_buffer_data(
&mut self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>;
fn set_command_buffer_data(
&mut self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>;
fn get_primitive_type(&self) -> VkPrimitiveTopology;
fn get_vertex_count(&self) -> usize;
fn get_index_count(&self) -> usize;
fn get_instance_count(&self) -> usize;
fn get_command_count(&self) -> usize;
fn iter_vertex_buffer_struct_members(
&self,
) -> IntoIter<(&'static str, MemberInfo)>;
fn get_index_type_id(&self) -> Option<TypeId>;
fn iter_instance_buffer_struct_members(
&self,
) -> Option<IntoIter<(&'static str, MemberInfo)>>;
fn iter_command_buffer_struct_members(
&self,
) -> Option<IntoIter<(&'static str, MemberInfo)>>;
fn get_vertex_type_name(&self) -> &'static str;
fn get_index_type_name(&self) -> &'static str;
fn get_instance_type_name(&self) -> &'static str;
fn get_command_type_name(&self) -> &'static str;
fn get_vertex_stride(&self) -> usize;
fn get_index_stride(&self) -> usize;
fn get_instance_stride(&self) -> usize;
fn get_command_stride(&self) -> usize;
fn flush(&self, cmdbuf: VkCommandBuffer) -> Result<(), VulkanError>;
fn discard_staging_buffers(&self);
// Provided method
fn get_index_type(&self) -> Option<VkIndexType> { ... }
}Expand description
The trait for a mesh
Required Methods§
Sourcefn clone(&self) -> Box<dyn GenericMesh>
fn clone(&self) -> Box<dyn GenericMesh>
Clone the mesh
Sourcefn get_vk_vertex_buffer(&self) -> VkBuffer
fn get_vk_vertex_buffer(&self) -> VkBuffer
Get the vertex buffer
Sourcefn get_vk_index_buffer(&self) -> Option<VkBuffer>
fn get_vk_index_buffer(&self) -> Option<VkBuffer>
Get the index buffer
Sourcefn get_vk_instance_buffer(&self) -> Option<VkBuffer>
fn get_vk_instance_buffer(&self) -> Option<VkBuffer>
Get the instance buffer
Sourcefn get_vk_command_buffer(&self) -> Option<VkBuffer>
fn get_vk_command_buffer(&self) -> Option<VkBuffer>
Get the command buffer
Sourcefn create_index_buffer(
&mut self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>
fn create_index_buffer( &mut self, data: *const c_void, size: usize, ) -> Result<(), VulkanError>
Create the index buffer
Sourcefn create_instance_buffer(
&mut self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>
fn create_instance_buffer( &mut self, data: *const c_void, size: usize, ) -> Result<(), VulkanError>
Create the instance buffer
Sourcefn create_command_buffer(
&mut self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>
fn create_command_buffer( &mut self, data: *const c_void, size: usize, ) -> Result<(), VulkanError>
Create the command buffer
Sourcefn set_vertex_buffer_data(
&self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>
fn set_vertex_buffer_data( &self, data: *const c_void, size: usize, ) -> Result<(), VulkanError>
Get the vertex buffer
Sourcefn set_index_buffer_data(
&mut self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>
fn set_index_buffer_data( &mut self, data: *const c_void, size: usize, ) -> Result<(), VulkanError>
Get the index buffer
Sourcefn set_instance_buffer_data(
&mut self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>
fn set_instance_buffer_data( &mut self, data: *const c_void, size: usize, ) -> Result<(), VulkanError>
Get the instance buffer
Sourcefn set_command_buffer_data(
&mut self,
data: *const c_void,
size: usize,
) -> Result<(), VulkanError>
fn set_command_buffer_data( &mut self, data: *const c_void, size: usize, ) -> Result<(), VulkanError>
Get the command buffer
Sourcefn get_primitive_type(&self) -> VkPrimitiveTopology
fn get_primitive_type(&self) -> VkPrimitiveTopology
Get the primitive type
Sourcefn get_vertex_count(&self) -> usize
fn get_vertex_count(&self) -> usize
Get vertex count
Sourcefn get_index_count(&self) -> usize
fn get_index_count(&self) -> usize
Get index count
Sourcefn get_instance_count(&self) -> usize
fn get_instance_count(&self) -> usize
Get instance count
Sourcefn get_command_count(&self) -> usize
fn get_command_count(&self) -> usize
Get command count
Sourcefn iter_vertex_buffer_struct_members(
&self,
) -> IntoIter<(&'static str, MemberInfo)>
fn iter_vertex_buffer_struct_members( &self, ) -> IntoIter<(&'static str, MemberInfo)>
Get the iterator for the vertex buffer item structure
Sourcefn get_index_type_id(&self) -> Option<TypeId>
fn get_index_type_id(&self) -> Option<TypeId>
Get the TypeId of the index buffer item
Sourcefn iter_instance_buffer_struct_members(
&self,
) -> Option<IntoIter<(&'static str, MemberInfo)>>
fn iter_instance_buffer_struct_members( &self, ) -> Option<IntoIter<(&'static str, MemberInfo)>>
Get the iterator for the vertex buffer item structure
Sourcefn iter_command_buffer_struct_members(
&self,
) -> Option<IntoIter<(&'static str, MemberInfo)>>
fn iter_command_buffer_struct_members( &self, ) -> Option<IntoIter<(&'static str, MemberInfo)>>
Get the iterator for the vertex buffer item structure
Sourcefn get_vertex_type_name(&self) -> &'static str
fn get_vertex_type_name(&self) -> &'static str
Get the stride of the vertex buffer
Sourcefn get_index_type_name(&self) -> &'static str
fn get_index_type_name(&self) -> &'static str
Get the stride of the index buffer
Sourcefn get_instance_type_name(&self) -> &'static str
fn get_instance_type_name(&self) -> &'static str
Get the stride of the instance buffer
Sourcefn get_command_type_name(&self) -> &'static str
fn get_command_type_name(&self) -> &'static str
Get the stride of the command buffer
Sourcefn get_vertex_stride(&self) -> usize
fn get_vertex_stride(&self) -> usize
Get the stride of the vertex buffer
Sourcefn get_index_stride(&self) -> usize
fn get_index_stride(&self) -> usize
Get the stride of the index buffer
Sourcefn get_instance_stride(&self) -> usize
fn get_instance_stride(&self) -> usize
Get the stride of the instance buffer
Sourcefn get_command_stride(&self) -> usize
fn get_command_stride(&self) -> usize
Get the stride of the command buffer
Sourcefn flush(&self, cmdbuf: VkCommandBuffer) -> Result<(), VulkanError>
fn flush(&self, cmdbuf: VkCommandBuffer) -> Result<(), VulkanError>
Flush all buffers that needs to be flushed to use
Sourcefn discard_staging_buffers(&self)
fn discard_staging_buffers(&self)
Discard staging buffers if the data will never be modified.
Provided Methods§
Sourcefn get_index_type(&self) -> Option<VkIndexType>
fn get_index_type(&self) -> Option<VkIndexType>
Get the index type