Add default impl for bindings trait function

This commit is contained in:
hodasemi 2023-01-27 22:13:35 +01:00
parent 1a7e31e1d3
commit e62853ad61

View file

@ -52,7 +52,14 @@ impl Default for ShaderType {
} }
pub trait VertexInputDescription: ReprC { pub trait VertexInputDescription: ReprC {
fn bindings() -> Vec<VkVertexInputBindingDescription>; fn bindings() -> Vec<VkVertexInputBindingDescription> {
vec![VkVertexInputBindingDescription {
binding: 0,
stride: std::mem::size_of::<Self>() as u32,
inputRate: VK_VERTEX_INPUT_RATE_VERTEX,
}]
}
fn attributes() -> Vec<VkVertexInputAttributeDescription>; fn attributes() -> Vec<VkVertexInputAttributeDescription>;
} }