summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2025-06-02 14:00:26 -0700
committerGitHub <noreply@github.com>2025-06-02 14:00:26 -0700
commiteaaa86fae4d02ba4163c904367cd5f96fda43865 (patch)
treeda95472862e99e40d863d5ef45c8669443f97723
parent24d0c25f7de7b30ef436c90b2f02bb41165d99b7 (diff)
Use MatrixResultSignedComponents on OpCooperativeVectorMatrixMulNV (#7227)
-rw-r--r--source/slang/hlsl.meta.slang14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang
index 73e69fdf3..6a3ae63ec 100644
--- a/source/slang/hlsl.meta.slang
+++ b/source/slang/hlsl.meta.slang
@@ -26372,9 +26372,14 @@ CoopVec<T, M> coopVecMatMulPacked(
let inputInterpretationSpirv : int32_t = __getSpvCoopVecComponentType(inputInterpretation);
let memoryLayoutSpirv : int32_t = __getSpvCoopVecMatrixLayout(memoryLayout);
let matrixPtr = matrix.GetBufferPointer();
+ int operands = 0; // NoneKHR
+ if (__isSignedInt<T>())
+ {
+ operands |= 0x08; // MatrixResultSignedComponentsKHR
+ }
return spirv_asm
{
- result:$$CoopVec<T, M> = OpCooperativeVectorMatrixMulNV $input $inputInterpretationSpirv $matrixPtr $matrixOffset $matrixInterpretationSpirv $m $k $memoryLayoutSpirv $transpose $matrixStride;
+ result:$$CoopVec<T, M> = OpCooperativeVectorMatrixMulNV $input $inputInterpretationSpirv $matrixPtr $matrixOffset $matrixInterpretationSpirv $m $k $memoryLayoutSpirv $transpose $matrixStride !operands;
};
case hlsl:
@@ -26903,9 +26908,14 @@ CoopVec<T, M> coopVecMatMulPacked(
let inputInterpretationSpirv : int32_t = __getSpvCoopVecComponentType(inputInterpretation);
let memoryLayoutSpirv : int32_t = __getSpvCoopVecMatrixLayout(memoryLayout);
let matrixPtr = __getStructuredBufferPtr(matrix);
+ int operands = 0; // NoneKHR
+ if (__isSignedInt<T>())
+ {
+ operands |= 0x08; // MatrixResultSignedComponentsKHR
+ }
return spirv_asm
{
- result:$$CoopVec<T, M> = OpCooperativeVectorMatrixMulNV $input $inputInterpretationSpirv $matrixPtr $matrixOffset $matrixInterpretationSpirv $m $k $memoryLayoutSpirv $transpose $matrixStride;
+ result:$$CoopVec<T, M> = OpCooperativeVectorMatrixMulNV $input $inputInterpretationSpirv $matrixPtr $matrixOffset $matrixInterpretationSpirv $m $k $memoryLayoutSpirv $transpose $matrixStride !operands;
};
}
}