-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for AbstractInts as inputs (#3306)
This PR adds in abstract ints to the Scalar type system, and wires up being able to write them as inputs as literals in shaders. Since they are abstract values they will never be supported as buffer inputs. Returning the values via buffers will be handled in a seperate PR. I have implemented the tests for AbstractInt -> i32 & u32 conversion to confirm the implementation operates as expected. There is a substantial number of changes related to the fact that the existing code assumes all numerics are `number`s, but AbstractInts need to be represented as BigInts. I have also cleaned up a couple of places related to the AbstractFloat implementation where there wasn't full testing coverage, etc. Issue #3302
- Loading branch information
Showing
30 changed files
with
550 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,107 @@ | ||
{ | ||
"webgpu/shader/execution/binary/af_addition.bin": "2c5e7574", | ||
"webgpu/shader/execution/binary/af_logical.bin": "2885252a", | ||
"webgpu/shader/execution/binary/af_division.bin": "de2c92cc", | ||
"webgpu/shader/execution/binary/af_matrix_addition.bin": "3c01149a", | ||
"webgpu/shader/execution/binary/af_matrix_subtraction.bin": "bd4616a3", | ||
"webgpu/shader/execution/binary/af_multiplication.bin": "30337a92", | ||
"webgpu/shader/execution/binary/af_remainder.bin": "b974c5d4", | ||
"webgpu/shader/execution/binary/af_subtraction.bin": "e532bbbe", | ||
"webgpu/shader/execution/binary/f16_addition.bin": "36beac4c", | ||
"webgpu/shader/execution/binary/f16_logical.bin": "48b5847", | ||
"webgpu/shader/execution/binary/f16_division.bin": "5377812e", | ||
"webgpu/shader/execution/binary/f16_matrix_addition.bin": "2f778220", | ||
"webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "8f7db49c", | ||
"webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "ccc6898f", | ||
"webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "66ab0554", | ||
"webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "c570c9d1", | ||
"webgpu/shader/execution/binary/f16_multiplication.bin": "eb1180d7", | ||
"webgpu/shader/execution/binary/f16_remainder.bin": "85b6f6f2", | ||
"webgpu/shader/execution/binary/f16_subtraction.bin": "17cb0c61", | ||
"webgpu/shader/execution/binary/f32_addition.bin": "7ed11615", | ||
"webgpu/shader/execution/binary/f32_logical.bin": "49eb7a68", | ||
"webgpu/shader/execution/binary/f32_division.bin": "73dbed8a", | ||
"webgpu/shader/execution/binary/f32_matrix_addition.bin": "72980509", | ||
"webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "58aa220c", | ||
"webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "f8b0e4a8", | ||
"webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "7878810e", | ||
"webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "58d640f4", | ||
"webgpu/shader/execution/binary/f32_multiplication.bin": "16e09d10", | ||
"webgpu/shader/execution/binary/f32_remainder.bin": "a6c6a8fa", | ||
"webgpu/shader/execution/binary/f32_subtraction.bin": "6fa482ff", | ||
"webgpu/shader/execution/binary/i32_arithmetic.bin": "9428fcd7", | ||
"webgpu/shader/execution/binary/i32_comparison.bin": "11d07528", | ||
"webgpu/shader/execution/binary/u32_arithmetic.bin": "243cb8a1", | ||
"webgpu/shader/execution/binary/u32_comparison.bin": "272ae0fa", | ||
"webgpu/shader/execution/abs.bin": "aa2f77b4", | ||
"webgpu/shader/execution/acos.bin": "223ed115", | ||
"webgpu/shader/execution/acosh.bin": "e2b339c8", | ||
"webgpu/shader/execution/asin.bin": "b09c87", | ||
"webgpu/shader/execution/asinh.bin": "a269a791", | ||
"webgpu/shader/execution/atan.bin": "72435ef", | ||
"webgpu/shader/execution/atan2.bin": "c766ee54", | ||
"webgpu/shader/execution/atanh.bin": "ca85d013", | ||
"webgpu/shader/execution/bitcast.bin": "f1dfaef7", | ||
"webgpu/shader/execution/ceil.bin": "956505f5", | ||
"webgpu/shader/execution/clamp.bin": "f411b304", | ||
"webgpu/shader/execution/cos.bin": "40a28b62", | ||
"webgpu/shader/execution/cosh.bin": "ad54c793", | ||
"webgpu/shader/execution/cross.bin": "520c3390", | ||
"webgpu/shader/execution/degrees.bin": "c847ea4f", | ||
"webgpu/shader/execution/determinant.bin": "c601a65d", | ||
"webgpu/shader/execution/distance.bin": "466b0741", | ||
"webgpu/shader/execution/dot.bin": "8150a481", | ||
"webgpu/shader/execution/exp.bin": "47940592", | ||
"webgpu/shader/execution/exp2.bin": "ee99106", | ||
"webgpu/shader/execution/faceForward.bin": "71fd946c", | ||
"webgpu/shader/execution/floor.bin": "dc1e0116", | ||
"webgpu/shader/execution/fma.bin": "f8a5fcd0", | ||
"webgpu/shader/execution/fract.bin": "d64b4648", | ||
"webgpu/shader/execution/frexp.bin": "fcbd25a7", | ||
"webgpu/shader/execution/inverseSqrt.bin": "b9516be3", | ||
"webgpu/shader/execution/ldexp.bin": "cea8acfb", | ||
"webgpu/shader/execution/length.bin": "f2c1b5d4", | ||
"webgpu/shader/execution/log.bin": "50f2df6", | ||
"webgpu/shader/execution/log2.bin": "3fed9ca1", | ||
"webgpu/shader/execution/max.bin": "c687421f", | ||
"webgpu/shader/execution/min.bin": "93d6f7dd", | ||
"webgpu/shader/execution/mix.bin": "90fc51a1", | ||
"webgpu/shader/execution/modf.bin": "ffa60832", | ||
"webgpu/shader/execution/normalize.bin": "edab0498", | ||
"webgpu/shader/execution/pack2x16float.bin": "157b9079", | ||
"webgpu/shader/execution/pow.bin": "7013e734", | ||
"webgpu/shader/execution/quantizeToF16.bin": "d1b7619f", | ||
"webgpu/shader/execution/radians.bin": "35d5c4a4", | ||
"webgpu/shader/execution/reflect.bin": "8c78147", | ||
"webgpu/shader/execution/refract.bin": "f6797744", | ||
"webgpu/shader/execution/round.bin": "87053dcd", | ||
"webgpu/shader/execution/saturate.bin": "a6478965", | ||
"webgpu/shader/execution/sign.bin": "6764de33", | ||
"webgpu/shader/execution/sin.bin": "2a231111", | ||
"webgpu/shader/execution/sinh.bin": "f1aa29f4", | ||
"webgpu/shader/execution/smoothstep.bin": "446216ba", | ||
"webgpu/shader/execution/sqrt.bin": "8686bbeb", | ||
"webgpu/shader/execution/step.bin": "c7f41980", | ||
"webgpu/shader/execution/tan.bin": "3839e7f0", | ||
"webgpu/shader/execution/tanh.bin": "e98e67a7", | ||
"webgpu/shader/execution/transpose.bin": "4e422cd2", | ||
"webgpu/shader/execution/trunc.bin": "abc8cd37", | ||
"webgpu/shader/execution/unpack2x16float.bin": "9d44b030", | ||
"webgpu/shader/execution/unpack2x16snorm.bin": "2c62ccb1", | ||
"webgpu/shader/execution/unpack2x16unorm.bin": "953c2189", | ||
"webgpu/shader/execution/unpack4x8snorm.bin": "d7afd331", | ||
"webgpu/shader/execution/unpack4x8unorm.bin": "1de18638", | ||
"webgpu/shader/execution/unary/af_arithmetic.bin": "d81659dd", | ||
"webgpu/shader/execution/unary/af_assignment.bin": "3c291894", | ||
"webgpu/shader/execution/unary/bool_conversion.bin": "a772b7a8", | ||
"webgpu/shader/execution/unary/f16_arithmetic.bin": "42a82294", | ||
"webgpu/shader/execution/unary/f16_conversion.bin": "187f2a7d", | ||
"webgpu/shader/execution/unary/f32_arithmetic.bin": "1e8f5ba5", | ||
"webgpu/shader/execution/unary/f32_conversion.bin": "44626171", | ||
"webgpu/shader/execution/unary/i32_arithmetic.bin": "af2d5073", | ||
"webgpu/shader/execution/unary/i32_complement.bin": "d2454830", | ||
"webgpu/shader/execution/unary/i32_conversion.bin": "fff42cc4", | ||
"webgpu/shader/execution/unary/u32_complement.bin": "f999c865", | ||
"webgpu/shader/execution/unary/u32_conversion.bin": "a2f40c7e" | ||
"webgpu/shader/execution/binary/af_addition.bin": "eba1476", | ||
"webgpu/shader/execution/binary/af_logical.bin": "2fdff104", | ||
"webgpu/shader/execution/binary/af_division.bin": "df548fe", | ||
"webgpu/shader/execution/binary/af_matrix_addition.bin": "33fce0f", | ||
"webgpu/shader/execution/binary/af_matrix_subtraction.bin": "d91874cd", | ||
"webgpu/shader/execution/binary/af_multiplication.bin": "befd840b", | ||
"webgpu/shader/execution/binary/af_remainder.bin": "3e618e69", | ||
"webgpu/shader/execution/binary/af_subtraction.bin": "14237c9b", | ||
"webgpu/shader/execution/binary/f16_addition.bin": "331cde43", | ||
"webgpu/shader/execution/binary/f16_logical.bin": "2495b3b8", | ||
"webgpu/shader/execution/binary/f16_division.bin": "11c2c421", | ||
"webgpu/shader/execution/binary/f16_matrix_addition.bin": "49514138", | ||
"webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "2016658", | ||
"webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "c76b299d", | ||
"webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "4bec10fa", | ||
"webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "6192b162", | ||
"webgpu/shader/execution/binary/f16_multiplication.bin": "a0d0527b", | ||
"webgpu/shader/execution/binary/f16_remainder.bin": "b9839e66", | ||
"webgpu/shader/execution/binary/f16_subtraction.bin": "ebf7f0f4", | ||
"webgpu/shader/execution/binary/f32_addition.bin": "2f161871", | ||
"webgpu/shader/execution/binary/f32_logical.bin": "b792bcce", | ||
"webgpu/shader/execution/binary/f32_division.bin": "89cf19e6", | ||
"webgpu/shader/execution/binary/f32_matrix_addition.bin": "a4fd125f", | ||
"webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "e73d99e2", | ||
"webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "81f12724", | ||
"webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "dfabd8ab", | ||
"webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "3cbcfe99", | ||
"webgpu/shader/execution/binary/f32_multiplication.bin": "82ce5ae", | ||
"webgpu/shader/execution/binary/f32_remainder.bin": "7eea3091", | ||
"webgpu/shader/execution/binary/f32_subtraction.bin": "c4518267", | ||
"webgpu/shader/execution/binary/i32_arithmetic.bin": "35db562d", | ||
"webgpu/shader/execution/binary/i32_comparison.bin": "3aea1709", | ||
"webgpu/shader/execution/binary/u32_arithmetic.bin": "309aa9e3", | ||
"webgpu/shader/execution/binary/u32_comparison.bin": "74afab9", | ||
"webgpu/shader/execution/abs.bin": "cfde2529", | ||
"webgpu/shader/execution/acos.bin": "eb561980", | ||
"webgpu/shader/execution/acosh.bin": "e4f1c0f0", | ||
"webgpu/shader/execution/asin.bin": "a2fa8235", | ||
"webgpu/shader/execution/asinh.bin": "96567f9d", | ||
"webgpu/shader/execution/atan.bin": "6c853cbd", | ||
"webgpu/shader/execution/atan2.bin": "82c97086", | ||
"webgpu/shader/execution/atanh.bin": "5e60f704", | ||
"webgpu/shader/execution/bitcast.bin": "87c146d5", | ||
"webgpu/shader/execution/ceil.bin": "21383e91", | ||
"webgpu/shader/execution/clamp.bin": "1c96b539", | ||
"webgpu/shader/execution/cos.bin": "956b7a3d", | ||
"webgpu/shader/execution/cosh.bin": "f2bb8e16", | ||
"webgpu/shader/execution/cross.bin": "2a5f9027", | ||
"webgpu/shader/execution/degrees.bin": "46294f0d", | ||
"webgpu/shader/execution/determinant.bin": "23aa0a3e", | ||
"webgpu/shader/execution/distance.bin": "2b461512", | ||
"webgpu/shader/execution/dot.bin": "e38ea290", | ||
"webgpu/shader/execution/exp.bin": "4455696f", | ||
"webgpu/shader/execution/exp2.bin": "bb006599", | ||
"webgpu/shader/execution/faceForward.bin": "2bbbb0bd", | ||
"webgpu/shader/execution/floor.bin": "9b0d6e07", | ||
"webgpu/shader/execution/fma.bin": "33bcd52", | ||
"webgpu/shader/execution/fract.bin": "2ab6d19f", | ||
"webgpu/shader/execution/frexp.bin": "8dce4a7a", | ||
"webgpu/shader/execution/inverseSqrt.bin": "7c799f30", | ||
"webgpu/shader/execution/ldexp.bin": "ff53724f", | ||
"webgpu/shader/execution/length.bin": "348b0fe5", | ||
"webgpu/shader/execution/log.bin": "d4537242", | ||
"webgpu/shader/execution/log2.bin": "c4010158", | ||
"webgpu/shader/execution/max.bin": "c72c2f27", | ||
"webgpu/shader/execution/min.bin": "da1cc040", | ||
"webgpu/shader/execution/mix.bin": "7124ff44", | ||
"webgpu/shader/execution/modf.bin": "cce9a8fb", | ||
"webgpu/shader/execution/normalize.bin": "2aa96726", | ||
"webgpu/shader/execution/pack2x16float.bin": "3d47cf41", | ||
"webgpu/shader/execution/pow.bin": "ced94069", | ||
"webgpu/shader/execution/quantizeToF16.bin": "4d558863", | ||
"webgpu/shader/execution/radians.bin": "539694e5", | ||
"webgpu/shader/execution/reflect.bin": "fc996f65", | ||
"webgpu/shader/execution/refract.bin": "d5c12e24", | ||
"webgpu/shader/execution/round.bin": "8153f0e3", | ||
"webgpu/shader/execution/saturate.bin": "35cfdcb0", | ||
"webgpu/shader/execution/sign.bin": "b845eb5f", | ||
"webgpu/shader/execution/sin.bin": "ca416640", | ||
"webgpu/shader/execution/sinh.bin": "48a248a2", | ||
"webgpu/shader/execution/smoothstep.bin": "a4262b99", | ||
"webgpu/shader/execution/sqrt.bin": "ecb66d2f", | ||
"webgpu/shader/execution/step.bin": "441a1ff0", | ||
"webgpu/shader/execution/tan.bin": "139b44d2", | ||
"webgpu/shader/execution/tanh.bin": "6f034864", | ||
"webgpu/shader/execution/transpose.bin": "ce29e902", | ||
"webgpu/shader/execution/trunc.bin": "78326103", | ||
"webgpu/shader/execution/unpack2x16float.bin": "7d7f403e", | ||
"webgpu/shader/execution/unpack2x16snorm.bin": "3cb1dd10", | ||
"webgpu/shader/execution/unpack2x16unorm.bin": "e393809e", | ||
"webgpu/shader/execution/unpack4x8snorm.bin": "3c7c876", | ||
"webgpu/shader/execution/unpack4x8unorm.bin": "3cf4adca", | ||
"webgpu/shader/execution/unary/af_arithmetic.bin": "36ca2efd", | ||
"webgpu/shader/execution/unary/af_assignment.bin": "5952912c", | ||
"webgpu/shader/execution/unary/bool_conversion.bin": "70142326", | ||
"webgpu/shader/execution/unary/f16_arithmetic.bin": "dccd3bb1", | ||
"webgpu/shader/execution/unary/f16_conversion.bin": "b66d4a94", | ||
"webgpu/shader/execution/unary/f32_arithmetic.bin": "19370c80", | ||
"webgpu/shader/execution/unary/f32_conversion.bin": "1c842ed", | ||
"webgpu/shader/execution/unary/i32_arithmetic.bin": "7e5dfb12", | ||
"webgpu/shader/execution/unary/i32_complement.bin": "f49af0fa", | ||
"webgpu/shader/execution/unary/i32_conversion.bin": "c7859be0", | ||
"webgpu/shader/execution/unary/u32_complement.bin": "e32b513d", | ||
"webgpu/shader/execution/unary/u32_conversion.bin": "ea2e6707", | ||
"webgpu/shader/execution/unary/ai_assignment.bin": "cb143977" | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.