From eaaa86fae4d02ba4163c904367cd5f96fda43865 Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Mon, 2 Jun 2025 14:00:26 -0700 Subject: Use MatrixResultSignedComponents on OpCooperativeVectorMatrixMulNV (#7227) --- source/slang/hlsl.meta.slang | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source') 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 coopVecMatMulPacked( let inputInterpretationSpirv : int32_t = __getSpvCoopVecComponentType(inputInterpretation); let memoryLayoutSpirv : int32_t = __getSpvCoopVecMatrixLayout(memoryLayout); let matrixPtr = matrix.GetBufferPointer(); + int operands = 0; // NoneKHR + if (__isSignedInt()) + { + operands |= 0x08; // MatrixResultSignedComponentsKHR + } return spirv_asm { - result:$$CoopVec = OpCooperativeVectorMatrixMulNV $input $inputInterpretationSpirv $matrixPtr $matrixOffset $matrixInterpretationSpirv $m $k $memoryLayoutSpirv $transpose $matrixStride; + result:$$CoopVec = OpCooperativeVectorMatrixMulNV $input $inputInterpretationSpirv $matrixPtr $matrixOffset $matrixInterpretationSpirv $m $k $memoryLayoutSpirv $transpose $matrixStride !operands; }; case hlsl: @@ -26903,9 +26908,14 @@ CoopVec coopVecMatMulPacked( let inputInterpretationSpirv : int32_t = __getSpvCoopVecComponentType(inputInterpretation); let memoryLayoutSpirv : int32_t = __getSpvCoopVecMatrixLayout(memoryLayout); let matrixPtr = __getStructuredBufferPtr(matrix); + int operands = 0; // NoneKHR + if (__isSignedInt()) + { + operands |= 0x08; // MatrixResultSignedComponentsKHR + } return spirv_asm { - result:$$CoopVec = OpCooperativeVectorMatrixMulNV $input $inputInterpretationSpirv $matrixPtr $matrixOffset $matrixInterpretationSpirv $m $k $memoryLayoutSpirv $transpose $matrixStride; + result:$$CoopVec = OpCooperativeVectorMatrixMulNV $input $inputInterpretationSpirv $matrixPtr $matrixOffset $matrixInterpretationSpirv $m $k $memoryLayoutSpirv $transpose $matrixStride !operands; }; } } -- cgit v1.2.3