[dxbc] Implement Dmovc instruction

Fixes some mandelbrot demo mentioned in #216.
This commit is contained in:
Philip Rebohle 2018-11-10 23:27:56 +01:00
parent 0cfa5b16d3
commit a971370524
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 17 additions and 3 deletions

View File

@ -1680,11 +1680,20 @@ namespace dxvk {
// (src0) The condition vector
// (src1) Vector to select from if the condition is not 0
// (src2) Vector to select from if the condition is 0
const DxbcRegisterValue condition = emitRegisterLoad(ins.src[0], ins.dst[0].mask);
DxbcRegMask condMask = ins.dst[0].mask;
if (ins.dst[0].dataType == DxbcScalarType::Float64) {
condMask = DxbcRegMask(
condMask[0] && condMask[1],
condMask[2] && condMask[3],
false, false);
}
const DxbcRegisterValue condition = emitRegisterLoad(ins.src[0], condMask);
const DxbcRegisterValue selectTrue = emitRegisterLoad(ins.src[1], ins.dst[0].mask);
const DxbcRegisterValue selectFalse = emitRegisterLoad(ins.src[2], ins.dst[0].mask);
const uint32_t componentCount = ins.dst[0].mask.popCount();
uint32_t componentCount = condMask.popCount();
// We'll compare against a vector of zeroes to generate a
// boolean vector, which in turn will be used by OpSelect

View File

@ -1013,7 +1013,12 @@ namespace dxvk {
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float64 },
} },
/* DMovc */
{ },
{ 4, DxbcInstClass::VectorCmov, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Float64 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Uint32 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float64 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float64 },
} },
/* DtoF */
{ 2, DxbcInstClass::ConvertFloat64, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Float32 },