From a9515d35307b0a9a8007111ba895c99b23bba3a7 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 14 Sep 2021 15:32:59 +0200 Subject: [PATCH] [dxso] Handle multiplication by zero in matrix ALU instructions --- src/dxso/dxso_compiler.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/dxso/dxso_compiler.cpp b/src/dxso/dxso_compiler.cpp index 14622e29..4c4e47c6 100644 --- a/src/dxso/dxso_compiler.cpp +++ b/src/dxso/dxso_compiler.cpp @@ -2360,12 +2360,7 @@ namespace dxvk { result.type.ctype = dst.type.ctype; result.type.ccount = componentCount; - DxsoVectorType scalarType; - scalarType.ctype = result.type.ctype; - scalarType.ccount = 1; - const uint32_t typeId = getVectorTypeId(result.type); - const uint32_t scalarTypeId = getVectorTypeId(scalarType); DxsoRegMask srcMask(true, true, true, dotCount == 4); std::array indices; @@ -2374,9 +2369,9 @@ namespace dxvk { DxsoRegister src1 = ctx.src[1]; for (uint32_t i = 0; i < componentCount; i++) { - indices[i] = m_module.opDot(scalarTypeId, - emitRegisterLoad(src0, srcMask).id, - emitRegisterLoad(src1, srcMask).id); + indices[i] = emitDot( + emitRegisterLoad(src0, srcMask), + emitRegisterLoad(src1, srcMask)).id; src1.id.num++; }