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.

36 lines
770B

  1. use ash::vk;
  2. use cgmath::{Vector2, Vector3};
  3. #[repr(C, packed)]
  4. pub struct Vertex {
  5. pub pos: Vector2<f32>,
  6. pub color: Vector3<f32>,
  7. }
  8. impl Vertex {
  9. pub const BIND_DESC: [vk::VertexInputBindingDescription; 1] = [
  10. vk::VertexInputBindingDescription {
  11. binding: 0,
  12. stride: std::mem::size_of::<Self>() as u32,
  13. input_rate: vk::VertexInputRate::VERTEX,
  14. }
  15. ];
  16. pub const ATTR_DESC: [vk::VertexInputAttributeDescription; 2] = [
  17. vk::VertexInputAttributeDescription {
  18. location: 0,
  19. binding: 0,
  20. format: vk::Format::R32G32_SFLOAT,
  21. offset: 0,
  22. },
  23. vk::VertexInputAttributeDescription {
  24. location: 1,
  25. binding: 0,
  26. format: vk::Format::R32G32B32_SFLOAT,
  27. offset: std::mem::size_of::<Vector2<f32>>() as u32,
  28. },
  29. ];
  30. }
  31. // EOF