Skip to content

Commit

Permalink
test: use proper alignment for float16 vertex format
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanderc authored and ErichDonGubler committed Dec 12, 2024
1 parent e1c56f5 commit 69f8ddf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions tests/tests/vertex_formats/draw.vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ struct AttributeBlock4{
@location(1) float32x2: vec2<f32>,
@location(2) float32x3: vec3<f32>,
@location(3) float32x4: vec4<f32>,
@location(4) float16: f32,
@location(5) float16x2: vec2<f32>,
@location(6) float16x4: vec4<f32>,
@location(4) float16x2: vec2<f32>,
@location(5) float16x4: vec4<f32>,
@location(6) float16: f32,
}

@vertex
Expand Down Expand Up @@ -253,8 +253,6 @@ fn vertex_block_4(v_in: AttributeBlock4) -> @builtin(position) vec4<f32>

// Accumulate all float16 into one checksum value.
var all_float16: f32 = 0.0;
all_float16 = accumulate_float16(all_float16, v_in.float16);

all_float16 = accumulate_float16(all_float16, v_in.float16x2.x);
all_float16 = accumulate_float16(all_float16, v_in.float16x2.y);

Expand All @@ -263,6 +261,8 @@ fn vertex_block_4(v_in: AttributeBlock4) -> @builtin(position) vec4<f32>
all_float16 = accumulate_float16(all_float16, v_in.float16x4.z);
all_float16 = accumulate_float16(all_float16, v_in.float16x4.w);

all_float16 = accumulate_float16(all_float16, v_in.float16);

checksums[index_float16] = f32(all_float16);

return vec4(0.0);
Expand Down
6 changes: 3 additions & 3 deletions tests/tests/vertex_formats/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ async fn vertex_formats_all(ctx: TestingContext) {
1 => Float32x2,
2 => Float32x3,
3 => Float32x4,
4 => Float16,
5 => Float16x2,
6 => Float16x4,
4 => Float16x2,
5 => Float16x4,
6 => Float16,
];

let attributes_block_6 = &wgpu::vertex_attr_array![
Expand Down

0 comments on commit 69f8ddf

Please sign in to comment.