Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/webgpu/api/validation/render_pipeline/inter_stage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,23 +315,22 @@ g.test('max_variables_count,input')
u.combine('isAsync', [false, true]).combineWithParams([
// Number of user-defined output variables in test shader =
// device.limits.maxInterStageShaderVariables + numVariablesDelta
{ numVariablesDelta: 0, useExtraBuiltinInputs: false },
{ numVariablesDelta: 1, useExtraBuiltinInputs: false },
{ numVariablesDelta: 0, useExtraBuiltinInputs: true },
{ numVariablesDelta: -1, useExtraBuiltinInputs: true },
{ numVariablesDelta: 0, useExtraBuiltinInputs: false, _success: true },
{ numVariablesDelta: 1, useExtraBuiltinInputs: false, _success: false },
{ numVariablesDelta: -1, useExtraBuiltinInputs: true, _success: true },
{ numVariablesDelta: -2, useExtraBuiltinInputs: true, _success: false },
{ numVariablesDelta: -3, useExtraBuiltinInputs: true, _success: true },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT numVariablesDelta is how many to add to maxInterStageShaderVariables. I don't think you can really decide where how many to subtract and statically determine success without changing the rest of the test. If the test is in compatibility mode then only 1 extra builtin will be added. If it's in core, 3 will be added.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a thread about this above #4546 (comment)
and that's how we ended up with #4555. Actually I should close this PR (at least for now) in favor of that one.

] as const)
)
.fn(t => {
const { isAsync, numVariablesDelta, useExtraBuiltinInputs } = t.params;
const { isAsync, numVariablesDelta, useExtraBuiltinInputs, _success: success } = t.params;

const numVec4 = t.device.limits.maxInterStageShaderVariables + numVariablesDelta;
const numExtraVariables = useExtraBuiltinInputs ? 1 : 0;
const numUsedVariables = numVec4 + numExtraVariables;
const success = numUsedVariables <= t.device.limits.maxInterStageShaderVariables;

const outputs = range(numVec4, i => `@location(${i}) vout${i}: vec4<f32>`);
const inputs = range(numVec4, i => `@location(${i}) fin${i}: vec4<f32>`);

// NOTE: `numVec4` matches `inputs.length` here. We use this property later.
if (useExtraBuiltinInputs) {
inputs.push('@builtin(front_facing) front_facing_in: bool');
if (!t.isCompatibility) {
Expand Down