You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
770 B

use ash::vk;
use cgmath::{Vector2, Vector3};
#[repr(C, packed)]
pub struct Vertex {
pub pos: Vector2<f32>,
pub color: Vector3<f32>,
}
impl Vertex {
pub const BIND_DESC: [vk::VertexInputBindingDescription; 1] = [
vk::VertexInputBindingDescription {
binding: 0,
stride: std::mem::size_of::<Self>() as u32,
input_rate: vk::VertexInputRate::VERTEX,
}
];
pub const ATTR_DESC: [vk::VertexInputAttributeDescription; 2] = [
vk::VertexInputAttributeDescription {
location: 0,
binding: 0,
format: vk::Format::R32G32_SFLOAT,
offset: 0,
},
vk::VertexInputAttributeDescription {
location: 1,
binding: 0,
format: vk::Format::R32G32B32_SFLOAT,
offset: std::mem::size_of::<Vector2<f32>>() as u32,
},
];
}
// EOF