diff --git a/src/resources/cache/hashes.json b/src/resources/cache/hashes.json index 48c819594290..d6e28b282679 100644 --- a/src/resources/cache/hashes.json +++ b/src/resources/cache/hashes.json @@ -1,110 +1,110 @@ { - "webgpu/shader/execution/binary/af_addition.bin": "de575056", - "webgpu/shader/execution/binary/af_logical.bin": "dc2105f8", - "webgpu/shader/execution/binary/af_division.bin": "d7e6d98f", - "webgpu/shader/execution/binary/af_matrix_addition.bin": "c215cf6d", - "webgpu/shader/execution/binary/af_matrix_subtraction.bin": "57892276", - "webgpu/shader/execution/binary/af_multiplication.bin": "4c282ac2", - "webgpu/shader/execution/binary/af_remainder.bin": "9fdddf97", - "webgpu/shader/execution/binary/af_subtraction.bin": "a27de3c1", - "webgpu/shader/execution/binary/f16_addition.bin": "ecc2aa17", - "webgpu/shader/execution/binary/f16_logical.bin": "1851f647", - "webgpu/shader/execution/binary/f16_division.bin": "2cfec6de", - "webgpu/shader/execution/binary/f16_matrix_addition.bin": "f5b6ef4f", - "webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "c47070a0", - "webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "30b9d67c", - "webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "46b631ba", - "webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "19e6a937", - "webgpu/shader/execution/binary/f16_multiplication.bin": "8fbfc97c", - "webgpu/shader/execution/binary/f16_remainder.bin": "66cd384c", - "webgpu/shader/execution/binary/f16_subtraction.bin": "8b5fed3d", - "webgpu/shader/execution/binary/f32_addition.bin": "2ef1211a", - "webgpu/shader/execution/binary/f32_logical.bin": "3c97c69d", - "webgpu/shader/execution/binary/f32_division.bin": "2867ef0a", - "webgpu/shader/execution/binary/f32_matrix_addition.bin": "da9390d1", - "webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "2d67296e", - "webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "c79709f5", - "webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "38b7c05f", - "webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "f9b675d7", - "webgpu/shader/execution/binary/f32_multiplication.bin": "bb7ee512", - "webgpu/shader/execution/binary/f32_remainder.bin": "e0d16b8f", - "webgpu/shader/execution/binary/f32_subtraction.bin": "755fc63", - "webgpu/shader/execution/binary/i32_arithmetic.bin": "3c1d6f0f", - "webgpu/shader/execution/binary/i32_comparison.bin": "4759dfea", - "webgpu/shader/execution/binary/u32_arithmetic.bin": "6bf6989d", - "webgpu/shader/execution/binary/u32_comparison.bin": "ca8b140b", - "webgpu/shader/execution/abs.bin": "a79b85f3", - "webgpu/shader/execution/acos.bin": "eed1c72", - "webgpu/shader/execution/acosh.bin": "a1b7dc12", - "webgpu/shader/execution/asin.bin": "fbf69cb0", - "webgpu/shader/execution/asinh.bin": "7b8f7a8", - "webgpu/shader/execution/atan.bin": "250334d8", - "webgpu/shader/execution/atan2.bin": "9df3f787", - "webgpu/shader/execution/atanh.bin": "5c79c30d", - "webgpu/shader/execution/bitcast.bin": "964fdecd", - "webgpu/shader/execution/ceil.bin": "246bf087", - "webgpu/shader/execution/clamp.bin": "3a299eaf", - "webgpu/shader/execution/cos.bin": "d3efc52b", - "webgpu/shader/execution/cosh.bin": "867cbf85", - "webgpu/shader/execution/cross.bin": "a1089567", - "webgpu/shader/execution/degrees.bin": "d1cfaeac", - "webgpu/shader/execution/determinant.bin": "44faf0f8", - "webgpu/shader/execution/distance.bin": "e1191c92", - "webgpu/shader/execution/dot.bin": "242201b", - "webgpu/shader/execution/exp.bin": "e5f97f39", - "webgpu/shader/execution/exp2.bin": "65bd37ec", - "webgpu/shader/execution/faceForward.bin": "ebb6017a", - "webgpu/shader/execution/floor.bin": "a24e0ff8", - "webgpu/shader/execution/fma.bin": "87615a5f", - "webgpu/shader/execution/fract.bin": "eab1b9fa", - "webgpu/shader/execution/frexp.bin": "7dd8033", - "webgpu/shader/execution/inverseSqrt.bin": "356b47c5", - "webgpu/shader/execution/ldexp.bin": "788fdf3e", - "webgpu/shader/execution/length.bin": "69f13c20", - "webgpu/shader/execution/log.bin": "dc9c311c", - "webgpu/shader/execution/log2.bin": "d1a49443", - "webgpu/shader/execution/max.bin": "6750f2eb", - "webgpu/shader/execution/min.bin": "c8200395", - "webgpu/shader/execution/mix.bin": "86c40712", - "webgpu/shader/execution/modf.bin": "50483a83", - "webgpu/shader/execution/normalize.bin": "244a8e05", - "webgpu/shader/execution/pack2x16float.bin": "dcd8656d", - "webgpu/shader/execution/pow.bin": "633c917a", - "webgpu/shader/execution/quantizeToF16.bin": "f6044bd2", - "webgpu/shader/execution/radians.bin": "a90b21ea", - "webgpu/shader/execution/reflect.bin": "670fbba2", - "webgpu/shader/execution/refract.bin": "63b06feb", - "webgpu/shader/execution/round.bin": "d4c09bde", - "webgpu/shader/execution/saturate.bin": "d4f8a4d0", - "webgpu/shader/execution/sign.bin": "57c988b9", - "webgpu/shader/execution/sin.bin": "59aab9f5", - "webgpu/shader/execution/sinh.bin": "3890a90c", - "webgpu/shader/execution/smoothstep.bin": "b695fd45", - "webgpu/shader/execution/sqrt.bin": "9524c93", - "webgpu/shader/execution/step.bin": "b9cc90a4", - "webgpu/shader/execution/tan.bin": "e5792957", - "webgpu/shader/execution/tanh.bin": "ba99c688", - "webgpu/shader/execution/transpose.bin": "83588805", - "webgpu/shader/execution/trunc.bin": "aad5d037", - "webgpu/shader/execution/unpack2x16float.bin": "493cbe7b", - "webgpu/shader/execution/unpack2x16snorm.bin": "fd0b5eb9", - "webgpu/shader/execution/unpack2x16unorm.bin": "f7436a6c", - "webgpu/shader/execution/unpack4x8snorm.bin": "eca842d9", - "webgpu/shader/execution/unpack4x8unorm.bin": "8654f67e", - "webgpu/shader/execution/unary/af_arithmetic.bin": "e05d3c45", - "webgpu/shader/execution/unary/af_assignment.bin": "45da8cfe", - "webgpu/shader/execution/unary/bool_conversion.bin": "dd71f171", - "webgpu/shader/execution/unary/f16_arithmetic.bin": "9c17fdca", - "webgpu/shader/execution/unary/f16_conversion.bin": "c02b6c8", - "webgpu/shader/execution/unary/f32_arithmetic.bin": "feff26f7", - "webgpu/shader/execution/unary/f32_conversion.bin": "f2639f4c", - "webgpu/shader/execution/unary/i32_arithmetic.bin": "c69716e2", - "webgpu/shader/execution/unary/i32_conversion.bin": "83218e69", - "webgpu/shader/execution/unary/u32_conversion.bin": "8f5bad00", - "webgpu/shader/execution/unary/ai_assignment.bin": "c7e6ac33", - "webgpu/shader/execution/binary/ai_arithmetic.bin": "dfcd593a", - "webgpu/shader/execution/unary/ai_arithmetic.bin": "3d27dc97", - "webgpu/shader/execution/binary/af_matrix_matrix_multiplication.bin": "7e551ea1", - "webgpu/shader/execution/binary/af_matrix_scalar_multiplication.bin": "fe7ea65b", - "webgpu/shader/execution/binary/af_matrix_vector_multiplication.bin": "2a98deaa" + "webgpu/shader/execution/binary/af_addition.bin": "f6b8c7a3", + "webgpu/shader/execution/binary/af_logical.bin": "d97d5423", + "webgpu/shader/execution/binary/af_division.bin": "c0a23e30", + "webgpu/shader/execution/binary/af_matrix_addition.bin": "836fdadd", + "webgpu/shader/execution/binary/af_matrix_subtraction.bin": "c967f638", + "webgpu/shader/execution/binary/af_multiplication.bin": "4096f2d3", + "webgpu/shader/execution/binary/af_remainder.bin": "a3a0d73d", + "webgpu/shader/execution/binary/af_subtraction.bin": "439916d4", + "webgpu/shader/execution/binary/f16_addition.bin": "1d97efbd", + "webgpu/shader/execution/binary/f16_logical.bin": "b96c0fba", + "webgpu/shader/execution/binary/f16_division.bin": "72375b24", + "webgpu/shader/execution/binary/f16_matrix_addition.bin": "7d3ac55b", + "webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "8c677a43", + "webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "a77a4022", + "webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "1675b330", + "webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "d296aaeb", + "webgpu/shader/execution/binary/f16_multiplication.bin": "b73310de", + "webgpu/shader/execution/binary/f16_remainder.bin": "67826a5d", + "webgpu/shader/execution/binary/f16_subtraction.bin": "ae694c3f", + "webgpu/shader/execution/binary/f32_addition.bin": "2b015af2", + "webgpu/shader/execution/binary/f32_logical.bin": "bd92a193", + "webgpu/shader/execution/binary/f32_division.bin": "87969879", + "webgpu/shader/execution/binary/f32_matrix_addition.bin": "366919a9", + "webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "8eaed605", + "webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "a845e9d3", + "webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "525a1bf5", + "webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "c0bac301", + "webgpu/shader/execution/binary/f32_multiplication.bin": "ca19028f", + "webgpu/shader/execution/binary/f32_remainder.bin": "bc218fca", + "webgpu/shader/execution/binary/f32_subtraction.bin": "3df6f329", + "webgpu/shader/execution/binary/i32_arithmetic.bin": "d328867", + "webgpu/shader/execution/binary/i32_comparison.bin": "35670d91", + "webgpu/shader/execution/binary/u32_arithmetic.bin": "15d81411", + "webgpu/shader/execution/binary/u32_comparison.bin": "7c9a5f78", + "webgpu/shader/execution/abs.bin": "f5fe25df", + "webgpu/shader/execution/acos.bin": "d8cf5857", + "webgpu/shader/execution/acosh.bin": "4e8f86c6", + "webgpu/shader/execution/asin.bin": "8517bb78", + "webgpu/shader/execution/asinh.bin": "2671a2e6", + "webgpu/shader/execution/atan.bin": "d298ea1", + "webgpu/shader/execution/atan2.bin": "a98dc214", + "webgpu/shader/execution/atanh.bin": "f3e98b21", + "webgpu/shader/execution/bitcast.bin": "93e273f5", + "webgpu/shader/execution/ceil.bin": "21e50032", + "webgpu/shader/execution/clamp.bin": "98310607", + "webgpu/shader/execution/cos.bin": "4f19f415", + "webgpu/shader/execution/cosh.bin": "6ee3441d", + "webgpu/shader/execution/cross.bin": "f089bd63", + "webgpu/shader/execution/degrees.bin": "6c331a7b", + "webgpu/shader/execution/determinant.bin": "9518dde4", + "webgpu/shader/execution/distance.bin": "d30dbcee", + "webgpu/shader/execution/dot.bin": "8b06fea4", + "webgpu/shader/execution/exp.bin": "7b265d1b", + "webgpu/shader/execution/exp2.bin": "7c76a221", + "webgpu/shader/execution/faceForward.bin": "d43f1e4d", + "webgpu/shader/execution/floor.bin": "b843ea7d", + "webgpu/shader/execution/fma.bin": "b89b3496", + "webgpu/shader/execution/fract.bin": "dc7144da", + "webgpu/shader/execution/frexp.bin": "850b1e99", + "webgpu/shader/execution/inverseSqrt.bin": "61b87194", + "webgpu/shader/execution/ldexp.bin": "658eb70e", + "webgpu/shader/execution/length.bin": "ace4eb28", + "webgpu/shader/execution/log.bin": "963d3635", + "webgpu/shader/execution/log2.bin": "83f483ff", + "webgpu/shader/execution/max.bin": "eaeea5ec", + "webgpu/shader/execution/min.bin": "412cae2f", + "webgpu/shader/execution/mix.bin": "65773bcb", + "webgpu/shader/execution/modf.bin": "ce1ddfaf", + "webgpu/shader/execution/normalize.bin": "ecee5db4", + "webgpu/shader/execution/pack2x16float.bin": "f3a7b6bb", + "webgpu/shader/execution/pow.bin": "613a0e6c", + "webgpu/shader/execution/quantizeToF16.bin": "3433d327", + "webgpu/shader/execution/radians.bin": "96f2c12", + "webgpu/shader/execution/reflect.bin": "56bbbb7b", + "webgpu/shader/execution/refract.bin": "2b70fd66", + "webgpu/shader/execution/round.bin": "2c47b9f5", + "webgpu/shader/execution/saturate.bin": "e3555202", + "webgpu/shader/execution/sign.bin": "75756c6a", + "webgpu/shader/execution/sin.bin": "5a4f3a8b", + "webgpu/shader/execution/sinh.bin": "fa37178d", + "webgpu/shader/execution/smoothstep.bin": "3f5debdb", + "webgpu/shader/execution/sqrt.bin": "4c529e09", + "webgpu/shader/execution/step.bin": "b458b773", + "webgpu/shader/execution/tan.bin": "eb5dc8d8", + "webgpu/shader/execution/tanh.bin": "6b88d26d", + "webgpu/shader/execution/transpose.bin": "bdd82888", + "webgpu/shader/execution/trunc.bin": "b1d5a82f", + "webgpu/shader/execution/unpack2x16float.bin": "f03430bb", + "webgpu/shader/execution/unpack2x16snorm.bin": "9e840eb9", + "webgpu/shader/execution/unpack2x16unorm.bin": "726fac0f", + "webgpu/shader/execution/unpack4x8snorm.bin": "1f5e6f54", + "webgpu/shader/execution/unpack4x8unorm.bin": "8918267e", + "webgpu/shader/execution/unary/af_arithmetic.bin": "741de58c", + "webgpu/shader/execution/unary/af_assignment.bin": "6a2aaeb6", + "webgpu/shader/execution/unary/bool_conversion.bin": "2eadc2b3", + "webgpu/shader/execution/unary/f16_arithmetic.bin": "89aa5484", + "webgpu/shader/execution/unary/f16_conversion.bin": "b7c73364", + "webgpu/shader/execution/unary/f32_arithmetic.bin": "7cad96bf", + "webgpu/shader/execution/unary/f32_conversion.bin": "5b468aa4", + "webgpu/shader/execution/unary/i32_arithmetic.bin": "bed3c1f3", + "webgpu/shader/execution/unary/i32_conversion.bin": "ce4e9dc1", + "webgpu/shader/execution/unary/u32_conversion.bin": "3dbe0092", + "webgpu/shader/execution/unary/ai_assignment.bin": "ba16869", + "webgpu/shader/execution/binary/ai_arithmetic.bin": "64b9b1f0", + "webgpu/shader/execution/unary/ai_arithmetic.bin": "d55aa83c", + "webgpu/shader/execution/binary/af_matrix_matrix_multiplication.bin": "c62320ba", + "webgpu/shader/execution/binary/af_matrix_scalar_multiplication.bin": "836f8d94", + "webgpu/shader/execution/binary/af_matrix_vector_multiplication.bin": "24aeaaf" } \ No newline at end of file diff --git a/src/resources/cache/webgpu/shader/execution/bitcast.bin b/src/resources/cache/webgpu/shader/execution/bitcast.bin index d3954903ac89..3c24c88e1ffb 100644 Binary files a/src/resources/cache/webgpu/shader/execution/bitcast.bin and b/src/resources/cache/webgpu/shader/execution/bitcast.bin differ diff --git a/src/webgpu/shader/validation/expression/call/builtin/abs.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/abs.spec.ts index b51fc02ade0d..cdd4e61aa189 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/abs.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/abs.spec.ts @@ -5,12 +5,7 @@ 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, - elementType, - kAllFloatAndConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, -} from '../../../../../util/conversion.js'; +import { TypeF16, elementType, kAllScalarsAndVec } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; import { @@ -22,10 +17,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatAndConcreteIntegerScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kAllScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/acos.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/acos.spec.ts index 8883bd72e11c..bacece05ad80 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/acos.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/acos.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { absBigInt } from '../../../../../util/math.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -27,10 +26,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/acosh.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/acosh.spec.ts index 29cb1aad44e1..33edff4663ee 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/acosh.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/acosh.spec.ts @@ -9,10 +9,9 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, TypeAbstractInt, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, TypeAbstractFloat, } from '../../../../../util/conversion.js'; import { isRepresentable } from '../../../../../util/floating_point.js'; @@ -29,10 +28,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/asin.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/asin.spec.ts index 82f426035729..0fe8c4449a6c 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/asin.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/asin.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { absBigInt } from '../../../../../util/math.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -27,10 +26,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/asinh.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/asinh.spec.ts index 6cff91c384da..30c466440179 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/asinh.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/asinh.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, TypeAbstractFloat, } from '../../../../../util/conversion.js'; import { isRepresentable } from '../../../../../util/floating_point.js'; @@ -29,10 +28,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); const additionalRangeForType = rangeForType( linearRange(-2000, 2000, 10), diff --git a/src/webgpu/shader/validation/expression/call/builtin/atan.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/atan.spec.ts index 8ad4230bc58d..c3b4d7ab24c8 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/atan.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/atan.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -26,10 +25,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/atanh.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/atanh.spec.ts index a299284c877b..90e22956fd32 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/atanh.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/atanh.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { absBigInt } from '../../../../../util/math.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -27,10 +26,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/ceil.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/ceil.spec.ts index d415c4b9dd3c..91d72fdb75f8 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/ceil.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/ceil.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -24,10 +23,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( 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 b05bc030f437..611895c3420f 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/clamp.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/clamp.spec.ts @@ -8,7 +8,9 @@ import { keysOf, objectsToRecord } from '../../../../../../common/util/data_tabl import { TypeF16, elementType, - kAllFloatAndConcreteIntegerScalarsAndVectors, + kAllFloatScalars, + kAllFloatScalarsAndVectors, + kAllConcreteIntegerScalarsAndVectors, } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -21,7 +23,10 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord(kAllFloatAndConcreteIntegerScalarsAndVectors); +const kValuesTypes = objectsToRecord([ + ...kAllFloatScalarsAndVectors, + ...kAllConcreteIntegerScalarsAndVectors +]); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/cos.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/cos.spec.ts index b62c236803c0..634755d21b9d 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/cos.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/cos.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -26,10 +25,8 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); + g.test('values') .desc( ` diff --git a/src/webgpu/shader/validation/expression/call/builtin/cosh.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/cosh.spec.ts index 55d0200ef16b..b4a3391ab42d 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/cosh.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/cosh.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, TypeAbstractFloat, } from '../../../../../util/conversion.js'; import { isRepresentable } from '../../../../../util/floating_point.js'; @@ -26,10 +25,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/degrees.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/degrees.spec.ts index 4e4137daf4bd..62cdfc15bdb4 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/degrees.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/degrees.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, TypeAbstractFloat, } from '../../../../../util/conversion.js'; import { isRepresentable } from '../../../../../util/floating_point.js'; @@ -26,10 +25,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/exp.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/exp.spec.ts index a7a37fb08cdb..c0ee408dfbe8 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/exp.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/exp.spec.ts @@ -9,11 +9,11 @@ import { kValue } from '../../../../../util/constants.js'; import { TypeF16, TypeF32, + TypeAbstractFloat, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - TypeAbstractFloat, - kAllAbstractIntegerScalarAndVectors, + kAllFloatScalarsAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { isRepresentable } from '../../../../../util/floating_point.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -27,10 +27,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); const valueForType = rangeForType( [ diff --git a/src/webgpu/shader/validation/expression/call/builtin/exp2.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/exp2.spec.ts index 40a8542b8d95..db578a2f64a0 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/exp2.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/exp2.spec.ts @@ -9,11 +9,11 @@ import { kValue } from '../../../../../util/constants.js'; import { TypeF16, TypeF32, + TypeAbstractFloat, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - TypeAbstractFloat, - kAllAbstractIntegerScalarAndVectors, + kAllFloatScalarsAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { isRepresentable } from '../../../../../util/floating_point.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -27,10 +27,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); const valueForType = rangeForType( [ diff --git a/src/webgpu/shader/validation/expression/call/builtin/floor.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/floor.spec.ts index 6a12c3d67db8..6aac652b8b3e 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/floor.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/floor.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -24,10 +23,8 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); + g.test('values') .desc( ` diff --git a/src/webgpu/shader/validation/expression/call/builtin/inverseSqrt.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/inverseSqrt.spec.ts index f459303d580b..09e1813fafc6 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/inverseSqrt.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/inverseSqrt.spec.ts @@ -9,10 +9,9 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, TypeAbstractFloat, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { isRepresentable } from '../../../../../util/floating_point.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -28,10 +27,8 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); + g.test('values') .desc( ` diff --git a/src/webgpu/shader/validation/expression/call/builtin/length.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/length.spec.ts index 1f24a86d9107..cb9be19963f2 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/length.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/length.spec.ts @@ -10,16 +10,12 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalars, - kAllFloatVector2, - kAllFloatVector3, - kAllFloatVector4, kAllConcreteIntegerScalarsAndVectors, - kAbstractIntegerScalar, - kAbstractIntegerVector2, + kConvertableToFloatScalar, + kConvertableToFloatVec2, + kConvertableToFloatVec3, + kConvertableToFloatVec4, TypeAbstractFloat, - kAbstractIntegerVector3, - kAbstractIntegerVector4, } from '../../../../../util/conversion.js'; import { isRepresentable } from '../../../../../util/floating_point.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -72,7 +68,7 @@ function calculate( }; } -const kScalarTypes = objectsToRecord([...kAbstractIntegerScalar, ...kAllFloatScalars]); +const kScalarTypes = objectsToRecord(kConvertableToFloatScalar); g.test('scalar') .desc( @@ -106,7 +102,7 @@ the input scalar value always compiles without error ); }); -const kVec2Types = objectsToRecord([...kAbstractIntegerVector2, ...kAllFloatVector2]); +const kVec2Types = objectsToRecord(kConvertableToFloatVec2); g.test('vec2') .desc( @@ -141,7 +137,7 @@ Validates that constant evaluation and override evaluation of ${builtin}() with ); }); -const kVec3Types = objectsToRecord([...kAbstractIntegerVector3, ...kAllFloatVector3]); +const kVec3Types = objectsToRecord(kConvertableToFloatVec3); g.test('vec3') .desc( @@ -177,7 +173,7 @@ Validates that constant evaluation and override evaluation of ${builtin}() with ); }); -const kVec4Types = objectsToRecord([...kAbstractIntegerVector4, ...kAllFloatVector4]); +const kVec4Types = objectsToRecord(kConvertableToFloatVec4); g.test('vec4') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/log.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/log.spec.ts index bffc433103e8..95c085937902 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/log.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/log.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -24,10 +23,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/log2.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/log2.spec.ts index 6eaf08993c8c..96aba411b9ff 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/log2.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/log2.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -24,10 +23,8 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); + g.test('values') .desc( ` diff --git a/src/webgpu/shader/validation/expression/call/builtin/modf.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/modf.spec.ts index bdb0691436f4..a86613b546c9 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/modf.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/modf.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -24,10 +23,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/radians.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/radians.spec.ts index 8cb7f62d92b9..c108f3aff80c 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/radians.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/radians.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -24,10 +23,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/round.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/round.spec.ts index 267c743c805f..c013607c6b16 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/round.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/round.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { fpTraitsFor } from '../../../../../util/floating_point.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -26,10 +25,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/saturate.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/saturate.spec.ts index c7b0a50e9409..c6158ec0314b 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/saturate.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/saturate.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -24,10 +23,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/sign.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/sign.spec.ts index f844961aee27..568c8f7c37d9 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/sign.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/sign.spec.ts @@ -9,7 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatAndSignedIntegerScalarsAndVectors, + kAllFloatScalarsAndVectors, + kAllSignedIntegerScalarsAndVectors, kAllUnsignedIntegerScalarsAndVectors, } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -23,7 +24,10 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord(kAllFloatAndSignedIntegerScalarsAndVectors); +const kValuesTypes = objectsToRecord([ + ...kAllFloatScalarsAndVectors, + ...kAllSignedIntegerScalarsAndVectors +]); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/sin.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/sin.spec.ts index 9e0d091e11d0..6a52564304e7 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/sin.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/sin.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -26,10 +25,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/sinh.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/sinh.spec.ts index d4c94e1a5290..8f37e8b16fe8 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/sinh.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/sinh.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, TypeAbstractFloat, } from '../../../../../util/conversion.js'; import { isRepresentable } from '../../../../../util/floating_point.js'; @@ -26,10 +25,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/sqrt.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/sqrt.spec.ts index 0844652acdf6..1c692c614b84 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/sqrt.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/sqrt.spec.ts @@ -9,9 +9,8 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, + kConvertableToFloatScalarsAndVec, TypeAbstractFloat, } from '../../../../../util/conversion.js'; import { isRepresentable } from '../../../../../util/floating_point.js'; @@ -28,10 +27,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/shader/validation/expression/call/builtin/tan.spec.ts b/src/webgpu/shader/validation/expression/call/builtin/tan.spec.ts index 02616455a67e..68183013cab1 100644 --- a/src/webgpu/shader/validation/expression/call/builtin/tan.spec.ts +++ b/src/webgpu/shader/validation/expression/call/builtin/tan.spec.ts @@ -9,10 +9,9 @@ import { TypeF16, TypeF32, elementType, - kAllFloatScalarsAndVectors, kAllConcreteIntegerScalarsAndVectors, - kAllAbstractIntegerScalarAndVectors, TypeAbstractFloat, + kConvertableToFloatScalarsAndVec, } from '../../../../../util/conversion.js'; import { fpTraitsFor } from '../../../../../util/floating_point.js'; import { ShaderValidationTest } from '../../../shader_validation_test.js'; @@ -28,10 +27,7 @@ import { export const g = makeTestGroup(ShaderValidationTest); -const kValuesTypes = objectsToRecord([ - ...kAllAbstractIntegerScalarAndVectors, - ...kAllFloatScalarsAndVectors, -]); +const kValuesTypes = objectsToRecord(kConvertableToFloatScalarsAndVec); g.test('values') .desc( diff --git a/src/webgpu/util/conversion.ts b/src/webgpu/util/conversion.ts index ac6ff5bbea38..603a4747fdf4 100644 --- a/src/webgpu/util/conversion.ts +++ b/src/webgpu/util/conversion.ts @@ -1654,33 +1654,26 @@ export function isFloatType(ty: Type): boolean { export const kAllFloatScalars = [TypeAbstractFloat, TypeF32, TypeF16] as const; /// All floating-point vec2 types -export const kAllFloatVector2 = [ +const kAllFloatVector2 = [ TypeVec(2, TypeAbstractFloat), TypeVec(2, TypeF32), TypeVec(2, TypeF16), ] as const; /// All floating-point vec3 types -export const kAllFloatVector3 = [ +const kAllFloatVector3 = [ TypeVec(3, TypeAbstractFloat), TypeVec(3, TypeF32), TypeVec(3, TypeF16), ] as const; /// All floating-point vec4 types -export const kAllFloatVector4 = [ +const kAllFloatVector4 = [ TypeVec(4, TypeAbstractFloat), TypeVec(4, TypeF32), TypeVec(4, TypeF16), ] as const; -/// All floating-point vector types -export const kAllFloatVectors = [ - ...kAllFloatVector2, - ...kAllFloatVector3, - ...kAllFloatVector4, -] as const; - /// All f16 floating-point scalar and vector types export const kAllF16ScalarsAndVectors = [ TypeF16, @@ -1690,31 +1683,11 @@ export const kAllF16ScalarsAndVectors = [ ] as const; /// All floating-point scalar and vector types -export const kAllFloatScalarsAndVectors = [...kAllFloatScalars, ...kAllFloatVectors] as const; - -/// Abstract integer scalar type -export const kAbstractIntegerScalar = [TypeAbstractInt] as const; - -/// Abstract integer vec2 type -export const kAbstractIntegerVector2 = [TypeVec(2, TypeAbstractInt)] as const; - -/// Abstract integer vec3 type -export const kAbstractIntegerVector3 = [TypeVec(3, TypeAbstractInt)] as const; - -/// Abstract integer vec4 type -export const kAbstractIntegerVector4 = [TypeVec(4, TypeAbstractInt)] as const; - -/// All abstract integer scalar vector types -export const kAbstractIntegerVectors = [ - ...kAbstractIntegerVector2, - ...kAbstractIntegerVector3, - ...kAbstractIntegerVector4, -] as const; - -/// Abstract integer scalar and vector types -export const kAllAbstractIntegerScalarAndVectors = [ - ...kAbstractIntegerScalar, - ...kAbstractIntegerVectors, +export const kAllFloatScalarsAndVectors = [ + ...kAllFloatScalars, + ...kAllFloatVector2, + ...kAllFloatVector3, + ...kAllFloatVector4, ] as const; // Abstract and concrete integer types are not grouped into an 'all' type, @@ -1752,16 +1725,43 @@ export const kAllUnsignedIntegerScalarsAndVectors = [ TypeVec(4, TypeU32), ] as const; -/// All floating-point and integer scalar and vector types -export const kAllFloatAndConcreteIntegerScalarsAndVectors = [ - ...kAllFloatScalarsAndVectors, - ...kAllConcreteIntegerScalarsAndVectors, +/// All types which are convertable to floating-point scalar types. +export const kConvertableToFloatScalar = [ + TypeAbstractInt, + ...kAllFloatScalars, +] as const; + +/// All types which are convertable to floating-point vector 2 types. +export const kConvertableToFloatVec2 = [ + TypeVec(2, TypeAbstractInt), + ...kAllFloatVector2, +] as const; + +/// All types which are convertable to floating-point vector 3 types. +export const kConvertableToFloatVec3 = [ + TypeVec(3, TypeAbstractInt), + ...kAllFloatVector3, +] as const; + +/// All types which are convertable to floating-point vector 4 types. +export const kConvertableToFloatVec4 = [ + TypeVec(4, TypeAbstractInt), + ...kAllFloatVector4, ] as const; -/// All floating-point and signed integer scalar and vector types -export const kAllFloatAndSignedIntegerScalarsAndVectors = [ +/// All types which are convertable to floating-point scalar or vector types. +export const kConvertableToFloatScalarsAndVec = [ + TypeAbstractInt, + TypeVec(2, TypeAbstractInt), + TypeVec(3, TypeAbstractInt), + TypeVec(4, TypeAbstractInt), ...kAllFloatScalarsAndVectors, - ...kAllSignedIntegerScalarsAndVectors, +] as const; + +/// All the scalar and vector types +export const kAllScalarsAndVec = [ + ...kConvertableToFloatScalarsAndVec, + ...kAllConcreteIntegerScalarsAndVectors, ] as const; /** @returns the inner element type of the given type */