From 21346ded32be9091389ca53815c1ba56feff8a01 Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Wed, 21 May 2025 13:43:58 +0000 Subject: 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. --- source/slang/hlsl.meta.slang | 12 ++++++------ 1 file 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() || __isSignedInt()) { - if (U is __BuiltinSignedArithmeticType) + if (__isFloat() || __isSignedInt()) __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() || __isSignedInt()) __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() || __isSignedInt()) { - if (U is __BuiltinSignedArithmeticType) + if (__isFloat() || __isSignedInt()) __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() || __isSignedInt()) __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)"; -- cgit v1.2.3