Skip to content

Commit

Permalink
compat: fix more flat either issues (gpuweb#3837)
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman authored Jul 8, 2024
1 parent 9ce0ee7 commit 1f393f9
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const kAttributeCases = {
// diagnostic is a keyword
group: `@group(0) @binding(0) var s : sampler;`,
id: `@id(1) override x : i32;`,
interpolate: `@fragment fn main(@location(0) @interpolate(flat) x : i32) { }`,
interpolate: `@fragment fn main(@location(0) @interpolate(flat, either) x : i32) { }`,
invariant: `@fragment fn main(@builtin(position) @invariant pos : vec4f) { }`,
location: `@fragment fn main(@location(0) x : f32) { }`,
must_use: `@must_use fn foo() -> u32 { return 0; }`,
Expand Down Expand Up @@ -102,6 +102,17 @@ g.test('builtin_value_names')
.beginSubcases()
.combine('decl', ['override', 'const', 'var<private>'] as const)
)
.beforeAllSubcases(t => {
const wgsl = kBuiltinCases[t.params.case];
t.skipIf(
t.isCompatibility && wgsl.includes('sample_mask'),
'sample_mask is not supported in compatibility mode'
);
t.skipIf(
t.isCompatibility && wgsl.includes('sample_index'),
'sample_index is not supported in compatibility mode'
);
})
.fn(t => {
const code = `
${t.params.decl} ${t.params.case} : u32 = 0;
Expand Down Expand Up @@ -325,6 +336,12 @@ g.test('interpolation_sampling_names')
.beginSubcases()
.combine('decl', ['override', 'const', 'var<private>'] as const)
)
.beforeAllSubcases(t => {
t.skipIf(
t.isCompatibility && t.params.case === 'sample',
'compatibility mode does not support sample sampling'
);
})
.fn(t => {
const code = `
${t.params.decl} ${t.params.case} : u32 = 0;
Expand All @@ -347,6 +364,12 @@ g.test('interpolation_flat_names')
.beginSubcases()
.combine('decl', ['override', 'const', 'var<private>'] as const)
)
.beforeAllSubcases(t => {
t.skipIf(
t.isCompatibility && t.params.case === 'first',
'compatibility mode does not support first sampling'
);
})
.fn(t => {
const code = `
${t.params.decl} ${t.params.case} : u32 = 0;
Expand Down

0 comments on commit 1f393f9

Please sign in to comment.