31 lines
708 B
Rust
31 lines
708 B
Rust
use engine::prelude::*;
|
|
use utilities::impl_reprc;
|
|
|
|
impl_reprc!(
|
|
pub struct VertexPoint {
|
|
#[assume_reprc]
|
|
v: [f32; 4],
|
|
}
|
|
);
|
|
|
|
impl VertexPoint {
|
|
pub fn new(x: impl Into<f32>, y: impl Into<f32>, z: impl Into<f32>) -> Self {
|
|
VertexPoint {
|
|
v: [x.into(), y.into(), z.into(), 1.0],
|
|
}
|
|
}
|
|
}
|
|
|
|
impl VertexInputDescription for VertexPoint {
|
|
fn attributes() -> Vec<VkVertexInputAttributeDescription> {
|
|
vec![
|
|
// position
|
|
VkVertexInputAttributeDescription {
|
|
location: 0,
|
|
binding: 0,
|
|
format: VK_FORMAT_R32G32B32_SFLOAT,
|
|
offset: 0,
|
|
},
|
|
]
|
|
}
|
|
}
|