1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[d3d9] Always slightly bias viewport, regardless of size

Since we got TRUNC_COORD on RADV, we always need to bias this now.

Closes: #1854
This commit is contained in:
Joshua Ashton 2020-12-14 03:51:35 +00:00
parent 495b2a098e
commit 65635b23c1

View File

@ -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,