Skip to content

Commit

Permalink
More WGSL flat issues (#3935)
Browse files Browse the repository at this point in the history
Fix a few more tests that should no longer fail in compat
as errors have been moved from shader creation time to
pipeline creation time.
  • Loading branch information
greggman authored Sep 6, 2024
1 parent 9045fed commit dfe6729
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/webgpu/shader/validation/shader_io/interpolate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ g.test('integral_types')
use_struct: t.params.use_struct,
});

const expectSuccess = t.isCompatibility
? t.params.attribute === '@interpolate(flat, either)'
: t.params.attribute.startsWith('@interpolate(flat');
const expectSuccess = t.params.attribute.startsWith('@interpolate(flat');
t.expectCompileResult(expectSuccess, code);
});

Expand All @@ -153,7 +151,7 @@ g.test('duplicate')
t.expectCompileResult(t.params.attr === '', code);
});

const kValidationTests: { [key: string]: { src: string; pass: boolean; compatPass?: boolean } } = {
const kValidationTests: { [key: string]: { src: string; pass: boolean } } = {
valid: {
src: `@interpolate(perspective)`,
pass: true,
Expand All @@ -165,7 +163,6 @@ const kValidationTests: { [key: string]: { src: string; pass: boolean; compatPas
trailing_comma_one_arg: {
src: `@interpolate(flat,)`,
pass: true,
compatPass: false,
},
trailing_comma_two_arg: {
src: `@interpolate(perspective, center,)`,
Expand Down Expand Up @@ -223,9 +220,6 @@ g.test('interpolation_validation')
@builtin(position) vec4<f32> {
return vec4f(0);
}`;
const expectSuccess =
kValidationTests[t.params.attr].pass &&
(t.isCompatibility ? kValidationTests[t.params.attr].compatPass ?? true : true);

const expectSuccess = kValidationTests[t.params.attr].pass;
t.expectCompileResult(expectSuccess, code);
});

0 comments on commit dfe6729

Please sign in to comment.