From 45d41267f54b707bd441a0559addcabec3ef0c4e Mon Sep 17 00:00:00 2001 From: raven02 Date: Fri, 1 Jul 2016 15:02:40 +0800 Subject: [PATCH] DX12: depth buffer compare should perform only if depth testing is enabled (#1848) --- rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp b/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp index 2957cf514f..702c127ab7 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp @@ -154,10 +154,15 @@ void D3D12GSRender::load_program() default: break; } + if (!!(rsx::method_registers[NV4097_SET_DEPTH_TEST_ENABLE])) + { + prop.DepthStencil.DepthEnable = TRUE; + prop.DepthStencil.DepthFunc = get_compare_func(rsx::method_registers[NV4097_SET_DEPTH_FUNC]); + } + else + prop.DepthStencil.DepthEnable = FALSE; - prop.DepthStencil.DepthEnable = !!(rsx::method_registers[NV4097_SET_DEPTH_TEST_ENABLE]); prop.DepthStencil.DepthWriteMask = !!(rsx::method_registers[NV4097_SET_DEPTH_MASK]) ? D3D12_DEPTH_WRITE_MASK_ALL : D3D12_DEPTH_WRITE_MASK_ZERO; - prop.DepthStencil.DepthFunc = get_compare_func(rsx::method_registers[NV4097_SET_DEPTH_FUNC]); prop.DepthStencil.StencilEnable = !!(rsx::method_registers[NV4097_SET_STENCIL_TEST_ENABLE]); prop.DepthStencil.StencilReadMask = rsx::method_registers[NV4097_SET_STENCIL_FUNC_MASK]; prop.DepthStencil.StencilWriteMask = rsx::method_registers[NV4097_SET_STENCIL_MASK];