1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-04 07:24:15 +01:00

[d3d11] Do not enable depth bias if the parameters are zero

This commit is contained in:
Philip Rebohle 2019-01-17 00:53:54 +01:00
parent 422198952a
commit 4819287029
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -41,8 +41,10 @@ namespace dxvk {
? VK_FRONT_FACE_COUNTER_CLOCKWISE
: VK_FRONT_FACE_CLOCKWISE;
// Let's treat the depth bias as enabled by default
m_state.depthBiasEnable = VK_TRUE;
// In the backend we treat depth bias as a dynamic state because
// some games like to put random/uninitialized numbers here, but
// we do not need to enable it in case the parameters are both 0.
m_state.depthBiasEnable = desc.DepthBias != 0 || desc.SlopeScaledDepthBias != 0.0f;
m_state.depthBiasConstant = static_cast<float>(desc.DepthBias);
m_state.depthBiasClamp = desc.DepthBiasClamp;
m_state.depthBiasSlope = desc.SlopeScaledDepthBias;