Skip to content

Commit

Permalink
Compat: Skip more tests for sample_* validation (gpuweb#3776)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrprice authored Jun 3, 2024
1 parent 5c23d90 commit dc0e978
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/webgpu/api/validation/render_pipeline/inter_stage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,12 @@ g.test('max_components_count,input')
}

if (useExtraBuiltinInputs) {
inputs.push(
'@builtin(front_facing) front_facing_in: bool',
'@builtin(sample_mask) sample_mask_in: u32'
);
inputs.push('@builtin(front_facing) front_facing_in: bool');
if (!t.isCompatibility) {
inputs.push('@builtin(sample_index) sample_index_in: u32');
inputs.push(
'@builtin(sample_mask) sample_mask_in: u32',
'@builtin(sample_index) sample_index_in: u32'
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,7 @@ g.test('inputs,sample_mask')
interpolation: { type, sampling },
} = t.params;
t.skipIfInterpolationTypeOrSamplingNotSupported({ type, sampling });
t.skipIf(t.isCompatibility, 'sample_mask is not supported in compatibility mode');
})
.fn(async t => {
const {
Expand Down
19 changes: 17 additions & 2 deletions src/webgpu/shader/validation/shader_io/builtins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ g.test('stage_inout')
.combine('target_io', ['in', 'out'] as const)
.beginSubcases()
)
.beforeAllSubcases(t => {
t.skipIf(
t.isCompatibility && ['sample_index', 'sample_mask'].includes(t.params.name),
'compatibility mode does not support sample_index or sample_mask'
);
})
.fn(t => {
const code = generateShader({
attribute: `@builtin(${t.params.name})`,
Expand Down Expand Up @@ -108,6 +114,12 @@ g.test('type')
.combine('target_type', kTestTypes)
.combine('use_struct', [true, false] as const)
)
.beforeAllSubcases(t => {
t.skipIf(
t.isCompatibility && ['sample_index', 'sample_mask'].includes(t.params.name),
'compatibility mode does not support sample_index or sample_mask'
);
})
.fn(t => {
let code = '';

Expand Down Expand Up @@ -146,10 +158,10 @@ g.test('nesting')
.beginSubcases()
)
.fn(t => {
// Generate a struct that contains a sample_mask builtin, nested inside another struct.
// Generate a struct that contains a frag_depth builtin, nested inside another struct.
let code = `
struct Inner {
@builtin(sample_mask) value : u32
@builtin(frag_depth) value : f32
};
struct Outer {
inner : Inner
Expand Down Expand Up @@ -182,6 +194,9 @@ g.test('duplicates')
.combine('second', ['p2', 's1b', 's2b', 'rb'] as const)
.beginSubcases()
)
.beforeAllSubcases(t => {
t.skipIf(t.isCompatibility, 'compatibility mode does not support sample_mask');
})
.fn(t => {
const p1 =
t.params.first === 'p1' ? '@builtin(sample_mask)' : '@location(1) @interpolate(flat)';
Expand Down
6 changes: 6 additions & 0 deletions src/webgpu/shader/validation/uniformity/uniformity.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ const kFragmentBuiltinValues = [
g.test('fragment_builtin_values')
.desc(`Test uniformity of fragment built-in values`)
.params(u => u.combineWithParams(kFragmentBuiltinValues).beginSubcases())
.beforeAllSubcases(t => {
t.skipIf(
t.isCompatibility && ['sample_index', 'sample_mask'].includes(t.params.builtin),
'compatibility mode does not support sample_index or sample_mask'
);
})
.fn(t => {
let cond = ``;
switch (t.params.type) {
Expand Down

0 comments on commit dc0e978

Please sign in to comment.