summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2025-05-21 13:43:58 +0000
committerGitHub <noreply@github.com>2025-05-21 06:43:58 -0700
commit21346ded32be9091389ca53815c1ba56feff8a01 (patch)
treed14c14a18364a6bc0fdd00a0c0e4dd0e17c4bd68
parentc4b6ef0bd6a7b7de131786c661c7e3423e318d7e (diff)
Fix incorrect way of type checking inside of CoopVec Multiply (#7198)
* Fix incorrect way of type checking inside of CoopVec Multiply Related to an issue #7201. The operator `is` is silently failing when the right-hand-side operand is an interface type. This PR uses concrete types to check the type.
-rw-r--r--source/slang/hlsl.meta.slang12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang
index e3d2d9dd2..2aa3068fa 100644
--- a/source/slang/hlsl.meta.slang
+++ b/source/slang/hlsl.meta.slang
@@ -24921,16 +24921,16 @@ for(auto buffer : kByteAddressBufferCases) {
__target_switch
{
case hlsl:
- if (T is __BuiltinSignedArithmeticType)
+ if (__isFloat<T>() || __isSignedInt<T>())
{
- if (U is __BuiltinSignedArithmeticType)
+ if (__isFloat<U>() || __isSignedInt<U>())
__intrinsic_asm "__builtin_MatVecMul($0, false, $1, false, $2, $3, $4, $5, $6, $7, $8, $9, $10)";
else
__intrinsic_asm "__builtin_MatVecMul($0, false, $1, true, $2, $3, $4, $5, $6, $7, $8, $9, $10)";
}
else
{
- if (U is __BuiltinSignedArithmeticType)
+ if (__isFloat<U>() || __isSignedInt<U>())
__intrinsic_asm "__builtin_MatVecMul($0, true, $1, false, $2, $3, $4, $5, $6, $7, $8, $9, $10)";
else
__intrinsic_asm "__builtin_MatVecMul($0, true, $1, true, $2, $3, $4, $5, $6, $7, $8, $9, $10)";
@@ -24953,16 +24953,16 @@ for(auto buffer : kByteAddressBufferCases) {
__target_switch
{
case hlsl:
- if (T is __BuiltinSignedArithmeticType)
+ if (__isFloat<T>() || __isSignedInt<T>())
{
- if (U is __BuiltinSignedArithmeticType)
+ if (__isFloat<U>() || __isSignedInt<U>())
__intrinsic_asm "__builtin_MatVecMulAdd($0, false, $1, false, $2, $3, $4, $5, $9, $10, $11, $12, $13, $6, $7, $8)";
else
__intrinsic_asm "__builtin_MatVecMulAdd($0, false, $1, true, $2, $3, $4, $5, $9, $10, $11, $12, $13, $6, $7, $8)";
}
else
{
- if (U is __BuiltinSignedArithmeticType)
+ if (__isFloat<U>() || __isSignedInt<U>())
__intrinsic_asm "__builtin_MatVecMulAdd($0, true, $1, false, $2, $3, $4, $5, $9, $10, $11, $12, $13, $6, $7, $8)";
else
__intrinsic_asm "__builtin_MatVecMulAdd($0, true, $1, true, $2, $3, $4, $5, $9, $10, $11, $12, $13, $6, $7, $8)";