Skip to content

Commit

Permalink
[dxso] Clamp Exp when fast float emulation is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
K0bin committed Feb 6, 2024
1 parent fae7840 commit e9a0fec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/dxso/dxso_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2029,12 +2029,22 @@ namespace dxvk {
result.id = resultIndices[0];
else
result.id = m_module.opCompositeConstruct(typeId, result.type.ccount, resultIndices.data());

if (m_moduleInfo.options.d3d9FloatEmulation == D3D9FloatEmulation::Enabled) {
result.id = m_module.opNMin(typeId, result.id,
m_module.constfReplicant(FLT_MAX, result.type.ccount));
}
break;
}
[[fallthrough]];
case DxsoOpcode::Exp:
result.id = m_module.opExp2(typeId,
emitRegisterLoad(src[0], mask).id);

if (m_moduleInfo.options.d3d9FloatEmulation == D3D9FloatEmulation::Enabled) {
result.id = m_module.opNMin(typeId, result.id,
m_module.constfReplicant(FLT_MAX, result.type.ccount));
}
break;
case DxsoOpcode::Pow: {
uint32_t base = emitRegisterLoad(src[0], mask).id;
Expand Down

0 comments on commit e9a0fec

Please sign in to comment.