From 4819287029817d8771962e387153f9275fb94e93 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 17 Jan 2019 00:53:54 +0100 Subject: [PATCH] [d3d11] Do not enable depth bias if the parameters are zero --- src/d3d11/d3d11_rasterizer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/d3d11/d3d11_rasterizer.cpp b/src/d3d11/d3d11_rasterizer.cpp index 2b35c700..aee5a7f5 100644 --- a/src/d3d11/d3d11_rasterizer.cpp +++ b/src/d3d11/d3d11_rasterizer.cpp @@ -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(desc.DepthBias); m_state.depthBiasClamp = desc.DepthBiasClamp; m_state.depthBiasSlope = desc.SlopeScaledDepthBias;