diff --git a/src/webgpu/shader/validation/expression/call/builtin/textureSample.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/textureSample.spec.ts index 584883ce0966..b6a8ae3ceeac 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/textureSample.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/textureSample.spec.ts @@ -105,9 +105,7 @@ Validates that only incorrect array_index arguments are rejected by ${builtin} u .combine('textureType', kTextureTypes) // filter out types with no array_index - .filter( - ({ textureType }) => !!kValidTextureSampleParameterTypes[textureType].hasArrayIndexArg - ) + .filter(t => !!kValidTextureSampleParameterTypes[t.textureType].hasArrayIndexArg) .combine('arrayIndexType', keysOf(kValuesTypes)) .beginSubcases() .combine('value', [-9, -8, 0, 7, 8]) @@ -145,10 +143,7 @@ Validates that only incorrect offset arguments are rejected by ${builtin} u .combine('textureType', kTextureTypes) // filter out types with no offset - .filter( - ({ textureType }) => - kValidTextureSampleParameterTypes[textureType].offsetArgType !== undefined - ) + .filter(t => !!kValidTextureSampleParameterTypes[t.textureType].offsetArgType) .combine('offsetType', keysOf(kValuesTypes)) .beginSubcases() .combine('value', [-9, -8, 0, 7, 8]) @@ -191,10 +186,7 @@ Validates that only non-const offset arguments are rejected by ${builtin} .combine('textureType', kTextureTypes) .combine('varType', ['c', 'u', 'l']) // filter out types with no offset - .filter( - ({ textureType }) => - kValidTextureSampleParameterTypes[textureType].offsetArgType !== undefined - ) + .filter(t => !!kValidTextureSampleParameterTypes[t.textureType].offsetArgType) ) .fn(t => { const { textureType, varType } = t.params; @@ -204,7 +196,6 @@ Validates that only non-const offset arguments are rejected by ${builtin} const coordWGSL = coordsArgType.create(0).wgsl(); const arrayWGSL = hasArrayIndexArg ? ', 0' : ''; const offsetWGSL = `${offsetArgType}(${varType})`; - const castWGSL = offsetArgType!.elementType.toString(); const code = ` @group(0) @binding(0) var s: sampler; @@ -212,7 +203,7 @@ Validates that only non-const offset arguments are rejected by ${builtin} @group(0) @binding(2) var u: ${offsetArgType}; @fragment fn fs(@builtin(position) p: vec4f) -> @location(0) vec4f { const c = 1; - let l = ${offsetArgType}(${castWGSL}(p.x)); + let l = ${offsetArgType!.create(0).wgsl()}; let v = textureSample(t, s, ${coordWGSL}${arrayWGSL}, ${offsetWGSL}); return vec4f(0); }