diff --git a/src/webgpu/shader/validation/expression/call/builtin/clamp.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/clamp.spec.ts index e94162b1ce5a..ff0114097f90 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/clamp.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/clamp.spec.ts @@ -127,6 +127,8 @@ Validates that low <= high. const scalar = scalarTypeOf(ty); return scalar !== Type.abstractInt && scalar !== Type.abstractFloat; }) + // in_shader: Is the function call statically accessed by the entry point? + .combine('in_shader', [false, true] as const) ) .beforeAllSubcases(t => { const ty = kValuesTypes[t.params.type]; @@ -176,7 +178,10 @@ fn foo() { const shader_error = error && t.params.lowStage === 'constant' && t.params.highStage === 'constant'; const pipeline_error = - error && t.params.lowStage !== 'runtime' && t.params.highStage !== 'runtime'; + t.params.in_shader && + error && + t.params.lowStage !== 'runtime' && + t.params.highStage !== 'runtime'; t.expectCompileResult(!shader_error, wgsl); if (!shader_error) { const constants: Record = {}; @@ -187,7 +192,7 @@ fn foo() { code: wgsl, constants, reference: ['o_low', 'o_high'], - statements: ['foo();'], + statements: t.params.in_shader ? ['foo();'] : [], }); } });