From 18a801de843931e96141bd789637540038268b99 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Tue, 13 Sep 2022 23:09:33 +0200 Subject: [PATCH] [dxso] Use a * (y - x) + x for lerp. Fixes Alice: Madness Returns. --- src/dxso/dxso_compiler.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/dxso/dxso_compiler.cpp b/src/dxso/dxso_compiler.cpp index d80ad019e..6da68189c 100644 --- a/src/dxso/dxso_compiler.cpp +++ b/src/dxso/dxso_compiler.cpp @@ -1429,14 +1429,11 @@ namespace dxvk { if (m_moduleInfo.options.d3d9FloatEmulation != D3D9FloatEmulation::Strict) return {x.type, m_module.opFMix(typeId, x.id, y.id, a.id)}; - uint32_t oneId = m_module.constfReplicant(1.0f, a.type.ccount); + DxsoRegisterValue ySubx; + ySubx.type = x.type; + ySubx.id = m_module.opFSub(typeId, y.id, x.id); - DxsoRegisterValue revA; - revA.type = a.type; - revA.id = m_module.opFSub(typeId, oneId, a.id); - - DxsoRegisterValue xRevA = emitMul(x, revA); - return emitFma(a, y, xRevA); + return emitFma(a, ySubx, x); }