summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/round.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/round.spec.ts')
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/round.spec.ts31
1 files changed, 17 insertions, 14 deletions
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/round.spec.ts b/dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/round.spec.ts
index 3a4ea0408a..dae7482c18 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/round.spec.ts
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/round.spec.ts
@@ -6,11 +6,10 @@ Validation tests for the ${builtin}() builtin.
import { makeTestGroup } from '../../../../../../common/framework/test_group.js';
import { keysOf, objectsToRecord } from '../../../../../../common/util/data_tables.js';
import {
- TypeF16,
- TypeF32,
- elementType,
- kAllFloatScalarsAndVectors,
- kAllIntegerScalarsAndVectors,
+ Type,
+ kConcreteIntegerScalarsAndVectors,
+ kConvertableToFloatScalarsAndVectors,
+ scalarTypeOf,
} from '../../../../../util/conversion.js';
import { fpTraitsFor } from '../../../../../util/floating_point.js';
import { ShaderValidationTest } from '../../../shader_validation_test.js';
@@ -25,7 +24,7 @@ import {
export const g = makeTestGroup(ShaderValidationTest);
-const kValuesTypes = objectsToRecord(kAllFloatScalarsAndVectors);
+const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVectors);
g.test('values')
.desc(
@@ -40,15 +39,19 @@ Validates that constant evaluation and override evaluation of ${builtin}() input
.filter(u => stageSupportsType(u.stage, kValuesTypes[u.type]))
.beginSubcases()
.expand('value', u => {
- const constants = fpTraitsFor(elementType(kValuesTypes[u.type])).constants();
- return unique(fullRangeForType(kValuesTypes[u.type]), [
- constants.negative.min + 0.1,
- constants.positive.max - 0.1,
- ]);
+ if (scalarTypeOf(kValuesTypes[u.type]).kind === 'abstract-int') {
+ return fullRangeForType(kValuesTypes[u.type]);
+ } else {
+ const constants = fpTraitsFor(scalarTypeOf(kValuesTypes[u.type])).constants();
+ return unique(fullRangeForType(kValuesTypes[u.type]), [
+ constants.negative.min + 0.1,
+ constants.positive.max - 0.1,
+ ]);
+ }
})
)
.beforeAllSubcases(t => {
- if (elementType(kValuesTypes[t.params.type]) === TypeF16) {
+ if (scalarTypeOf(kValuesTypes[t.params.type]) === Type.f16) {
t.selectDeviceOrSkipTestCase('shader-f16');
}
})
@@ -63,7 +66,7 @@ Validates that constant evaluation and override evaluation of ${builtin}() input
);
});
-const kIntegerArgumentTypes = objectsToRecord([TypeF32, ...kAllIntegerScalarsAndVectors]);
+const kIntegerArgumentTypes = objectsToRecord([Type.f32, ...kConcreteIntegerScalarsAndVectors]);
g.test('integer_argument')
.desc(
@@ -77,7 +80,7 @@ Validates that scalar and vector integer arguments are rejected by ${builtin}()
validateConstOrOverrideBuiltinEval(
t,
builtin,
- /* expectedResult */ type === TypeF32,
+ /* expectedResult */ type === Type.f32,
[type.create(1)],
'constant'
);