[dxso] Handle multiplication by zero in matrix ALU instructions

This commit is contained in:
Philip Rebohle 2021-09-14 15:32:59 +02:00 committed by Joshie
parent 8063e27c08
commit a9515d3530
1 changed files with 3 additions and 8 deletions

View File

@ -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<uint32_t, 4> 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++;
}