diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index edca7ad63..d56ab8296 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -5188,15 +5188,12 @@ namespace dxvk { const D3DVIEWPORT9& vp = m_state.viewport; // Correctness Factor for 1/2 texel offset - float cf = 0.5f; - - // HACK: UE3 bug re. tonemapper + shadow sampling being red:- - // We need to bias this, except when it's - // NOT powers of two in order to make - // imprecision biased towards infinity. - if ((vp.Width & (vp.Width - 1)) == 0 - && (vp.Height & (vp.Height - 1)) == 0) - cf -= 1.0f / 128.0f; + // We need to bias this slightly to make + // imprecision in games happy. + // Originally we did this only for powers of two + // resolutions but since NEAREST filtering fixed to + // truncate, we need to do this all the time now. + float cf = 0.5f - (1.0f / 128.0f); viewport = VkViewport{ float(vp.X) + cf, float(vp.Height + vp.Y) + cf,