From e227690798832851c8dee2c5f25ce3b92e2b087a Mon Sep 17 00:00:00 2001 From: Jinlei Li Date: Mon, 22 Jul 2024 12:19:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20index=20buffer=20=E7=9A=84?= =?UTF-8?q?=E5=86=97=E4=BD=99=20=20padding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/beginner/tutorial4-buffer/src/main.rs | 2 +- code/beginner/tutorial5-textures/src/main.rs | 2 +- code/beginner/tutorial6-uniforms/src/main.rs | 2 +- code/beginner/tutorial7-instancing/src/main.rs | 2 +- code/beginner/tutorial8-depth/src/main.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/beginner/tutorial4-buffer/src/main.rs b/code/beginner/tutorial4-buffer/src/main.rs index d930c3460..a968685e2 100644 --- a/code/beginner/tutorial4-buffer/src/main.rs +++ b/code/beginner/tutorial4-buffer/src/main.rs @@ -55,7 +55,7 @@ const VERTICES: &[Vertex] = &[ }, // E ]; -const INDICES: &[u16] = &[0, 1, 4, 1, 2, 4, 2, 3, 4, /* padding */ 0]; +const INDICES: &[u16] = &[0, 1, 4, 1, 2, 4, 2, 3, 4]; struct State { app: AppSurface, diff --git a/code/beginner/tutorial5-textures/src/main.rs b/code/beginner/tutorial5-textures/src/main.rs index 3c2b7b936..733f77783 100644 --- a/code/beginner/tutorial5-textures/src/main.rs +++ b/code/beginner/tutorial5-textures/src/main.rs @@ -59,7 +59,7 @@ const VERTICES: &[Vertex] = &[ }, // E ]; -const INDICES: &[u16] = &[0, 1, 4, 1, 2, 4, 2, 3, 4, /* padding */ 0]; +const INDICES: &[u16] = &[0, 1, 4, 1, 2, 4, 2, 3, 4]; struct State { app: AppSurface, diff --git a/code/beginner/tutorial6-uniforms/src/main.rs b/code/beginner/tutorial6-uniforms/src/main.rs index 3fddf367e..3795a9fde 100644 --- a/code/beginner/tutorial6-uniforms/src/main.rs +++ b/code/beginner/tutorial6-uniforms/src/main.rs @@ -63,7 +63,7 @@ const VERTICES: &[Vertex] = &[ }, // E ]; -const INDICES: &[u16] = &[0, 1, 4, 1, 2, 4, 2, 3, 4, /* padding */ 0]; +const INDICES: &[u16] = &[0, 1, 4, 1, 2, 4, 2, 3, 4]; struct Camera { eye: glam::Vec3, diff --git a/code/beginner/tutorial7-instancing/src/main.rs b/code/beginner/tutorial7-instancing/src/main.rs index 06f42b983..485c9fb46 100644 --- a/code/beginner/tutorial7-instancing/src/main.rs +++ b/code/beginner/tutorial7-instancing/src/main.rs @@ -71,7 +71,7 @@ const VERTICES: &[Vertex] = &[ }, // E ]; -const INDICES: &[u16] = &[0, 1, 4, 1, 2, 4, 2, 3, 4, /* padding */ 0]; +const INDICES: &[u16] = &[0, 1, 4, 1, 2, 4, 2, 3, 4]; struct Camera { eye: glam::Vec3, diff --git a/code/beginner/tutorial8-depth/src/main.rs b/code/beginner/tutorial8-depth/src/main.rs index 2dd2cfee0..f9ab81577 100644 --- a/code/beginner/tutorial8-depth/src/main.rs +++ b/code/beginner/tutorial8-depth/src/main.rs @@ -64,7 +64,7 @@ const VERTICES: &[Vertex] = &[ }, // E ]; -const INDICES: &[u16] = &[0, 1, 4, 1, 2, 4, 2, 3, 4, /* padding */ 0]; +const INDICES: &[u16] = &[0, 1, 4, 1, 2, 4, 2, 3, 4]; const NUM_INSTANCES_PER_ROW: u32 = 10; const INSTANCE_DISPLACEMENT: glam::Vec3 = glam::Vec3::new(