rustial_renderer_wgpu/gpu/
image_overlay_vertex.rs1use bytemuck::{Pod, Zeroable};
4
5#[repr(C)]
9#[derive(Debug, Clone, Copy, Pod, Zeroable)]
10pub struct ImageOverlayVertex {
11 pub position: [f32; 3],
13 pub uv: [f32; 2],
15 pub opacity: f32,
17}
18
19impl ImageOverlayVertex {
20 pub fn layout() -> wgpu::VertexBufferLayout<'static> {
22 wgpu::VertexBufferLayout {
23 array_stride: std::mem::size_of::<ImageOverlayVertex>() as wgpu::BufferAddress,
24 step_mode: wgpu::VertexStepMode::Vertex,
25 attributes: &[
26 wgpu::VertexAttribute {
28 offset: 0,
29 shader_location: 0,
30 format: wgpu::VertexFormat::Float32x3,
31 },
32 wgpu::VertexAttribute {
34 offset: 12,
35 shader_location: 1,
36 format: wgpu::VertexFormat::Float32x2,
37 },
38 wgpu::VertexAttribute {
40 offset: 20,
41 shader_location: 2,
42 format: wgpu::VertexFormat::Float32,
43 },
44 ],
45 }
46 }
47}