Skip to content

Commit

Permalink
删除 index buffer 的冗余 padding
Browse files Browse the repository at this point in the history
  • Loading branch information
jinleili committed Jul 22, 2024
1 parent 9b9cc71 commit e227690
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion code/beginner/tutorial4-buffer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion code/beginner/tutorial5-textures/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion code/beginner/tutorial6-uniforms/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion code/beginner/tutorial7-instancing/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion code/beginner/tutorial8-depth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit e227690

Please sign in to comment.