From 83295e01008bdf25e03f6b5aa18b93b735a5e326 Mon Sep 17 00:00:00 2001 From: Micha White Date: Sun, 18 Sep 2022 16:45:05 -0400 Subject: instancing --- src/vertex.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/vertex.rs') diff --git a/src/vertex.rs b/src/vertex.rs index 7735801..6514fd3 100644 --- a/src/vertex.rs +++ b/src/vertex.rs @@ -2,6 +2,7 @@ use std::mem::size_of; use bytemuck::{Pod, Zeroable}; +/// The vertices needed to form a square pub const SQUARE: [Vertex; 4] = [ Vertex::new(-0.5, -0.5), Vertex::new(0.5, -0.5), @@ -22,7 +23,9 @@ impl Vertex { } impl Vertex { - const ATTRIBUTES: [wgpu::VertexAttribute; 1] = wgpu::vertex_attr_array![0 => Float32x2]; + // whenever this is updated, please also update `sprite.wgsl` + pub(crate) const ATTRIBUTES: [wgpu::VertexAttribute; 1] = + wgpu::vertex_attr_array![0 => Float32x2]; pub(crate) const fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { wgpu::VertexBufferLayout { -- cgit v1.2.3