From 0f049edde61e45162aa69e15417ea8b1e45f3c97 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 17 Jan 2018 05:35:41 +0100 Subject: [PATCH] [dxbc] Fixed shift operations --- src/dxbc/dxbc_compiler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 64ba7f70..9aff75da 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -1610,8 +1610,11 @@ namespace dxvk { // (dst0) The destination register // (src0) The register to shift // (src1) The shift amount (scalar) - const DxbcRegisterValue shiftReg = emitRegisterLoad(ins.src[0], ins.dst[0].mask); - const DxbcRegisterValue countReg = emitRegisterLoad(ins.src[1], ins.dst[0].mask); + DxbcRegisterValue shiftReg = emitRegisterLoad(ins.src[0], ins.dst[0].mask); + DxbcRegisterValue countReg = emitRegisterLoad(ins.src[1], ins.dst[0].mask); + + if (countReg.type.ccount == 1) + countReg = emitRegisterExtend(countReg, shiftReg.type.ccount); DxbcRegisterValue result; result.type.ctype = ins.dst[0].dataType;