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:
parent
495b2a098e
commit
65635b23c1
@ -5188,15 +5188,12 @@ namespace dxvk {
|
|||||||
const D3DVIEWPORT9& vp = m_state.viewport;
|
const D3DVIEWPORT9& vp = m_state.viewport;
|
||||||
|
|
||||||
// Correctness Factor for 1/2 texel offset
|
// Correctness Factor for 1/2 texel offset
|
||||||
float cf = 0.5f;
|
// We need to bias this slightly to make
|
||||||
|
// imprecision in games happy.
|
||||||
// HACK: UE3 bug re. tonemapper + shadow sampling being red:-
|
// Originally we did this only for powers of two
|
||||||
// We need to bias this, except when it's
|
// resolutions but since NEAREST filtering fixed to
|
||||||
// NOT powers of two in order to make
|
// truncate, we need to do this all the time now.
|
||||||
// imprecision biased towards infinity.
|
float cf = 0.5f - (1.0f / 128.0f);
|
||||||
if ((vp.Width & (vp.Width - 1)) == 0
|
|
||||||
&& (vp.Height & (vp.Height - 1)) == 0)
|
|
||||||
cf -= 1.0f / 128.0f;
|
|
||||||
|
|
||||||
viewport = VkViewport{
|
viewport = VkViewport{
|
||||||
float(vp.X) + cf, float(vp.Height + vp.Y) + cf,
|
float(vp.X) + cf, float(vp.Height + vp.Y) + cf,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user