mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 20:52:10 +01:00
[dxso] normalize 0 to 0 with strict float emulation
This commit is contained in:
parent
85cc87e42a
commit
155944c2b4
@ -2070,18 +2070,18 @@ namespace dxvk {
|
||||
DxsoRegMask srcMask(true, true, true, false);
|
||||
auto vec3 = emitRegisterLoad(src[0], srcMask);
|
||||
|
||||
DxsoRegisterValue dot = emitDot(vec3, vec3);
|
||||
dot.id = m_module.opInverseSqrt (scalarTypeId, dot.id);
|
||||
// No need for emitDot, either both arguments or none are zero.
|
||||
// mul_zero has the same result as ieee mul.
|
||||
uint32_t dot = m_module.opDot(scalarTypeId, vec3.id, vec3.id);
|
||||
DxsoRegisterValue rcpLength;
|
||||
rcpLength.type = scalarType;
|
||||
rcpLength.id = m_module.opInverseSqrt(scalarTypeId, dot);
|
||||
if (m_moduleInfo.options.d3d9FloatEmulation == D3D9FloatEmulation::Enabled) {
|
||||
dot.id = m_module.opNMin (scalarTypeId, dot.id,
|
||||
m_module.constf32(FLT_MAX));
|
||||
rcpLength.id = m_module.opNMin(scalarTypeId, rcpLength.id, m_module.constf32(FLT_MAX));
|
||||
}
|
||||
|
||||
// r * rsq(r . r);
|
||||
result.id = m_module.opVectorTimesScalar(
|
||||
typeId,
|
||||
emitRegisterLoad(src[0], mask).id,
|
||||
dot.id);
|
||||
// r * rsq(r . r)
|
||||
result.id = emitMul(vec3, emitRegisterExtend(rcpLength, 3)).id;
|
||||
break;
|
||||
}
|
||||
case DxsoOpcode::SinCos: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user