Skip to content

Commit a971370

Browse files
committed
[dxbc] Implement Dmovc instruction
Fixes some mandelbrot demo mentioned in #216.
1 parent 0cfa5b1 commit a971370

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/dxbc/dxbc_compiler.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,11 +1680,20 @@ namespace dxvk {
16801680
// (src0) The condition vector
16811681
// (src1) Vector to select from if the condition is not 0
16821682
// (src2) Vector to select from if the condition is 0
1683-
const DxbcRegisterValue condition = emitRegisterLoad(ins.src[0], ins.dst[0].mask);
1683+
DxbcRegMask condMask = ins.dst[0].mask;
1684+
1685+
if (ins.dst[0].dataType == DxbcScalarType::Float64) {
1686+
condMask = DxbcRegMask(
1687+
condMask[0] && condMask[1],
1688+
condMask[2] && condMask[3],
1689+
false, false);
1690+
}
1691+
1692+
const DxbcRegisterValue condition = emitRegisterLoad(ins.src[0], condMask);
16841693
const DxbcRegisterValue selectTrue = emitRegisterLoad(ins.src[1], ins.dst[0].mask);
16851694
const DxbcRegisterValue selectFalse = emitRegisterLoad(ins.src[2], ins.dst[0].mask);
16861695

1687-
const uint32_t componentCount = ins.dst[0].mask.popCount();
1696+
uint32_t componentCount = condMask.popCount();
16881697

16891698
// We'll compare against a vector of zeroes to generate a
16901699
// boolean vector, which in turn will be used by OpSelect

src/dxbc/dxbc_defs.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,12 @@ namespace dxvk {
10131013
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float64 },
10141014
} },
10151015
/* DMovc */
1016-
{ },
1016+
{ 4, DxbcInstClass::VectorCmov, {
1017+
{ DxbcOperandKind::DstReg, DxbcScalarType::Float64 },
1018+
{ DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 },
1019+
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float64 },
1020+
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float64 },
1021+
} },
10171022
/* DtoF */
10181023
{ 2, DxbcInstClass::ConvertFloat64, {
10191024
{ DxbcOperandKind::DstReg, DxbcScalarType::Float32 },

0 commit comments

Comments
 (0)