diff --git a/src/webgpu/shader/execution/expression/access/array/index.spec.ts b/src/webgpu/shader/execution/expression/access/array/index.spec.ts index a56fd3b607dd..ab8830e5f501 100644 --- a/src/webgpu/shader/execution/expression/access/array/index.spec.ts +++ b/src/webgpu/shader/execution/expression/access/array/index.spec.ts @@ -3,7 +3,7 @@ Execution Tests for array indexing expressions `; import { makeTestGroup } from '../../../../../../common/framework/test_group.js'; -import { GPUTest } from '../../../../../gpu_test.js'; +import { AllFeaturesMaxLimitsGPUTest } from '../../../../../gpu_test.js'; import { False, True, @@ -17,7 +17,7 @@ import { align } from '../../../../../util/math.js'; import { Case } from '../../case.js'; import { allInputSources, basicExpressionBuilder, run } from '../../expression.js'; -export const g = makeTestGroup(GPUTest); +export const g = makeTestGroup(AllFeaturesMaxLimitsGPUTest); g.test('concrete_scalar') .specURL('https://www.w3.org/TR/WGSL/#array-access-expr') @@ -32,12 +32,10 @@ g.test('concrete_scalar') .combine('elementType', ['i32', 'u32', 'f32', 'f16'] as const) .combine('indexType', ['i32', 'u32'] as const) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.elementType === 'f16') { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const elementType = Type[t.params.elementType]; const indexType = Type[t.params.indexType]; const cases: Case[] = [ @@ -196,17 +194,16 @@ g.test('runtime_sized') ] as const) .combine('indexType', ['i32', 'u32'] as const) ) - .beforeAllSubcases(t => { - if (scalarTypeOf(Type[t.params.elementType]).kind === 'f16') { - t.selectDeviceOrSkipTestCase('shader-f16'); - } - }) .fn(t => { const elementType = Type[t.params.elementType]; const valueArrayType = Type.array(0, elementType); const indexType = Type[t.params.indexType]; const indexArrayType = Type.array(0, indexType); + if (scalarTypeOf(elementType).kind === 'f16') { + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); + } + const wgsl = ` ${scalarTypeOf(elementType).kind === 'f16' ? 'enable f16;' : ''} @@ -300,14 +297,13 @@ g.test('vector') ) .combine('indexType', ['i32', 'u32'] as const) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.elementType === 'vec4h') { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const elementType = Type[t.params.elementType]; const indexType = Type[t.params.indexType]; + const cases: Case[] = [ { input: [ @@ -372,12 +368,10 @@ g.test('matrix') return (align(mat.size, mat.alignment) & 15) === 0; }) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.elementType === 'f16') { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const elementType = Type[t.params.elementType]; const indexType = Type[t.params.indexType]; const matrixType = Type.mat(t.params.columns, t.params.rows, elementType); diff --git a/src/webgpu/shader/execution/expression/access/matrix/index.spec.ts b/src/webgpu/shader/execution/expression/access/matrix/index.spec.ts index b8872eeab99f..89e710b7864e 100644 --- a/src/webgpu/shader/execution/expression/access/matrix/index.spec.ts +++ b/src/webgpu/shader/execution/expression/access/matrix/index.spec.ts @@ -3,7 +3,7 @@ Execution Tests for matrix indexing expressions `; import { makeTestGroup } from '../../../../../../common/framework/test_group.js'; -import { GPUTest } from '../../../../../gpu_test.js'; +import { AllFeaturesMaxLimitsGPUTest } from '../../../../../gpu_test.js'; import { MatrixValue, ScalarValue, @@ -17,7 +17,7 @@ import { align } from '../../../../../util/math.js'; import { Case } from '../../case.js'; import { allInputSources, basicExpressionBuilder, run } from '../../expression.js'; -export const g = makeTestGroup(GPUTest); +export const g = makeTestGroup(AllFeaturesMaxLimitsGPUTest); g.test('concrete_float_column') .specURL('https://www.w3.org/TR/WGSL/#matrix-access-expr') @@ -30,12 +30,10 @@ g.test('concrete_float_column') .combine('columns', [2, 3, 4] as const) .combine('rows', [2, 3, 4] as const) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.elementType === 'f16') { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const elementType = Type[t.params.elementType]; const indexType = Type[t.params.indexType]; const matrixType = Type.mat(t.params.columns, t.params.rows, elementType); @@ -78,12 +76,10 @@ g.test('concrete_float_element') .combine('columns', [2, 3, 4] as const) .combine('rows', [2, 3, 4] as const) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.elementType === 'f16') { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const elementType = Type[t.params.elementType]; const indexType = Type[t.params.indexType]; const matrixType = Type.mat(t.params.columns, t.params.rows, elementType); diff --git a/src/webgpu/shader/execution/expression/access/structure/index.spec.ts b/src/webgpu/shader/execution/expression/access/structure/index.spec.ts index 59cbf4c6230d..3bcf92c0db06 100644 --- a/src/webgpu/shader/execution/expression/access/structure/index.spec.ts +++ b/src/webgpu/shader/execution/expression/access/structure/index.spec.ts @@ -3,13 +3,13 @@ Execution Tests for structure member accessing expressions `; import { makeTestGroup } from '../../../../../../common/framework/test_group.js'; -import { GPUTest } from '../../../../../gpu_test.js'; +import { AllFeaturesMaxLimitsGPUTest, GPUTest } from '../../../../../gpu_test.js'; import { ScalarKind, Type, Value, u32 } from '../../../../../util/conversion.js'; import { align } from '../../../../../util/math.js'; import { toComparator } from '../../expectation.js'; import { InputSource, structLayout, structStride } from '../../expression.js'; -export const g = makeTestGroup(GPUTest); +export const g = makeTestGroup(AllFeaturesMaxLimitsGPUTest); const kMemberTypes = [ ['bool'], @@ -140,12 +140,10 @@ g.test('buffer') .beginSubcases() .expand('member_index', t => t.member_types.map((_, i) => i)) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.member_types.includes('f16')) { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const values = t.params.member_types.map((ty, i) => Type[ty].create(i)); const expected = values[t.params.member_index]; @@ -286,12 +284,10 @@ g.test('buffer_pointer') .beginSubcases() .expand('member_index', t => t.member_types.map((_, i) => i)) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.member_types.includes('f16')) { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const values = t.params.member_types.map((ty, i) => Type[ty].create(i)); const expected = values[t.params.member_index]; @@ -328,12 +324,10 @@ g.test('let') .beginSubcases() .expand('member_index', t => t.member_types.map((_, i) => i)) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.member_types.includes('f16')) { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const memberType = Type[t.params.member_types[t.params.member_index]]; const values = t.params.member_types.map((ty, i) => Type[ty].create(i)); const expected = @@ -374,12 +368,10 @@ g.test('param') .beginSubcases() .expand('member_index', t => t.member_types.map((_, i) => i)) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.member_types.includes('f16')) { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const memberType = Type[t.params.member_types[t.params.member_index]]; const values = t.params.member_types.map((ty, i) => Type[ty].create(i)); const expected = @@ -423,12 +415,10 @@ g.test('const') .beginSubcases() .expand('member_index', t => t.member_types.map((_, i) => i)) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.member_types.includes('f16')) { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const memberType = Type[t.params.member_types[t.params.member_index]]; const values = t.params.member_types.map((ty, i) => Type[ty].create(i)); const expected = @@ -470,12 +460,10 @@ g.test('const_nested') .beginSubcases() .expand('member_index', t => t.member_types.map((_, i) => i)) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.member_types.includes('f16')) { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const memberType = Type[t.params.member_types[t.params.member_index]]; const values = t.params.member_types.map((ty, i) => Type[ty].create(i)); const expected = diff --git a/src/webgpu/shader/execution/expression/access/vector/components.spec.ts b/src/webgpu/shader/execution/expression/access/vector/components.spec.ts index 052833708782..01375dccb0d1 100644 --- a/src/webgpu/shader/execution/expression/access/vector/components.spec.ts +++ b/src/webgpu/shader/execution/expression/access/vector/components.spec.ts @@ -3,11 +3,11 @@ Execution Tests for vector component selection expressions `; import { makeTestGroup } from '../../../../../../common/framework/test_group.js'; -import { GPUTest } from '../../../../../gpu_test.js'; +import { AllFeaturesMaxLimitsGPUTest } from '../../../../../gpu_test.js'; import { ScalarValue, Type, VectorValue, f32 } from '../../../../../util/conversion.js'; import { allInputSources, basicExpressionBuilder, run } from '../../expression.js'; -export const g = makeTestGroup(GPUTest); +export const g = makeTestGroup(AllFeaturesMaxLimitsGPUTest); /** @returns the full permutation of component indices used to component select a vector of width 'n' */ function indices(n: number) { @@ -41,12 +41,10 @@ g.test('concrete_scalar') .beginSubcases() .expand('indices', u => indices(u.width)) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.elementType === 'f16') { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const elementType = Type[t.params.elementType]; const vectorType = Type.vec(t.params.width, elementType); const elementValues = diff --git a/src/webgpu/shader/execution/expression/access/vector/index.spec.ts b/src/webgpu/shader/execution/expression/access/vector/index.spec.ts index 28fbd0e86c69..41a2eb4d7816 100644 --- a/src/webgpu/shader/execution/expression/access/vector/index.spec.ts +++ b/src/webgpu/shader/execution/expression/access/vector/index.spec.ts @@ -3,12 +3,12 @@ Execution Tests for vector indexing expressions `; import { makeTestGroup } from '../../../../../../common/framework/test_group.js'; -import { GPUTest } from '../../../../../gpu_test.js'; +import { AllFeaturesMaxLimitsGPUTest } from '../../../../../gpu_test.js'; import { ScalarValue, Type, VectorValue, f32 } from '../../../../../util/conversion.js'; import { Case } from '../../case.js'; import { allInputSources, basicExpressionBuilder, run } from '../../expression.js'; -export const g = makeTestGroup(GPUTest); +export const g = makeTestGroup(AllFeaturesMaxLimitsGPUTest); g.test('concrete_scalar') .specURL('https://www.w3.org/TR/WGSL/#vector-access-expr') @@ -20,12 +20,10 @@ g.test('concrete_scalar') .combine('indexType', ['i32', 'u32'] as const) .combine('width', [2, 3, 4] as const) ) - .beforeAllSubcases(t => { + .fn(async t => { if (t.params.elementType === 'f16') { - t.selectDeviceOrSkipTestCase('shader-f16'); + t.skipIfDeviceDoesNotHaveFeature('shader-f16'); } - }) - .fn(async t => { const elementType = Type[t.params.elementType]; const indexType = Type[t.params.indexType]; const vectorType = Type.vec(t.params.width, elementType);