From a6037f015db2d15968ff18ee0888d0798b5d758f Mon Sep 17 00:00:00 2001 From: Asier Illarramendi Date: Fri, 17 Feb 2023 20:22:38 +0100 Subject: [PATCH] Improve instancing layout comments order I find it clearer if the comment explaining why 4 slots are needed is moved before the first slot definition. --- docs/beginner/tutorial7-instancing/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/beginner/tutorial7-instancing/README.md b/docs/beginner/tutorial7-instancing/README.md index 8f0a8434..7c97085f 100644 --- a/docs/beginner/tutorial7-instancing/README.md +++ b/docs/beginner/tutorial7-instancing/README.md @@ -148,6 +148,8 @@ impl InstanceRaw { // instance when the shader starts processing a new instance step_mode: wgpu::VertexStepMode::Instance, attributes: &[ + // A mat4 takes up 4 vertex slots as it is technically 4 vec4s. We need to define a slot + // for each vec4. We'll have to reassemble the mat4 in the shader. wgpu::VertexAttribute { offset: 0, // While our vertex shader only uses locations 0, and 1 now, in later tutorials we'll @@ -155,9 +157,6 @@ impl InstanceRaw { shader_location: 5, format: wgpu::VertexFormat::Float32x4, }, - // A mat4 takes up 4 vertex slots as it is technically 4 vec4s. We need to define a slot - // for each vec4. We'll have to reassemble the mat4 in - // the shader. wgpu::VertexAttribute { offset: mem::size_of::<[f32; 4]>() as wgpu::BufferAddress, shader_location: 6,