diff --git a/src/webgpu/shader/execution/expression/call/builtin/select.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/select.spec.ts index d49a714e417b..35587ce731a8 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/select.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/select.spec.ts @@ -30,10 +30,12 @@ import { vec2, vec3, vec4, + abstractFloat, + TypeAbstractFloat, } from '../../../../../util/conversion.js'; import { run, CaseList, allInputSources } from '../../expression.js'; -import { builtin } from './builtin.js'; +import { abstractBuiltin, builtin } from './builtin.js'; export const g = makeTestGroup(GPUTest); @@ -41,13 +43,17 @@ function makeBool(n: number) { return bool((n & 1) === 1); } -type scalarKind = 'b' | 'f' | 'h' | 'i' | 'u'; +type scalarKind = 'b' | 'af' | 'f' | 'h' | 'i' | 'u'; const dataType = { b: { type: TypeBool, constructor: makeBool, }, + af: { + type: TypeAbstractFloat, + constructor: abstractFloat, + }, f: { type: TypeF32, constructor: f32, @@ -72,13 +78,14 @@ g.test('scalar') .params(u => u .combine('inputSource', allInputSources) - .combine('component', ['b', 'f', 'h', 'i', 'u'] as const) + .combine('component', ['b', 'af', 'f', 'h', 'i', 'u'] as const) .combine('overload', ['scalar', 'vec2', 'vec3', 'vec4'] as const) ) .beforeAllSubcases(t => { if (t.params.component === 'h') { t.selectDeviceOrSkipTestCase({ requiredFeatures: ['shader-f16'] }); } + t.skipIf(t.params.component === 'af' && t.params.inputSource !== 'const'); }) .fn(async t => { const componentType = dataType[t.params.component as scalarKind].type; @@ -133,7 +140,7 @@ g.test('scalar') await run( t, - builtin('select'), + t.params.component !== 'af' ? builtin('select') : abstractBuiltin('select'), [overload.type, overload.type, TypeBool], overload.type, t.params, @@ -147,13 +154,14 @@ g.test('vector') .params(u => u .combine('inputSource', allInputSources) - .combine('component', ['b', 'f', 'h', 'i', 'u'] as const) + .combine('component', ['b', 'af', 'f', 'h', 'i', 'u'] as const) .combine('overload', ['vec2', 'vec3', 'vec4'] as const) ) .beforeAllSubcases(t => { if (t.params.component === 'h') { t.selectDeviceOrSkipTestCase({ requiredFeatures: ['shader-f16'] }); } + t.skipIf(t.params.component === 'af' && t.params.inputSource !== 'const'); }) .fn(async t => { const componentType = dataType[t.params.component as scalarKind].type; @@ -236,7 +244,7 @@ g.test('vector') await run( t, - builtin('select'), + t.params.component !== 'af' ? builtin('select') : abstractBuiltin('select'), [tests.dataType, tests.dataType, tests.boolType], tests.dataType, t.params,