mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-12 13:08:50 +01:00
[d3d9] Only apply viewport zBias if minZ is below 0.5
Fixes Space Marine shadows. Tests show that Windows D3D9 (Nvidia) works like that.
This commit is contained in:
parent
4b74d1a97b
commit
d11878e793
@ -5673,7 +5673,13 @@ namespace dxvk {
|
|||||||
|
|
||||||
// How much to bias MinZ by to avoid a depth
|
// How much to bias MinZ by to avoid a depth
|
||||||
// degenerate viewport.
|
// degenerate viewport.
|
||||||
constexpr float zBias = 0.001f;
|
// Tests show that the bias is only applied below minZ values of 0.5
|
||||||
|
float zBias;
|
||||||
|
if (vp.MinZ >= 0.5f) {
|
||||||
|
zBias = 0.0f;
|
||||||
|
} else {
|
||||||
|
zBias = 0.001f;
|
||||||
|
}
|
||||||
|
|
||||||
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…
Reference in New Issue
Block a user