diff --git a/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp b/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp index b02e48caa5..00b982c729 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp @@ -579,6 +579,8 @@ bool D3D12GSRender::LoadProgram() LOG_ERROR(RSX, "Bad surface color target: %d", m_surface_color_target); } + prop.depthEnabled = m_set_depth_test; + prop.IASet = m_IASet; m_PSO = m_cachePSO.getGraphicPipelineState(m_cur_vertex_prog, m_cur_fragment_prog, prop, std::make_pair(m_device, m_rootSignature)); diff --git a/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.h b/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.h index 22375bc3df..29e551a817 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.h +++ b/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.h @@ -17,11 +17,12 @@ struct D3D12PipelineProperties std::vector IASet; D3D12_BLEND_DESC Blend; unsigned numMRT : 3; + bool depthEnabled : 1; bool operator==(const D3D12PipelineProperties &in) const { // TODO: blend and IASet equality - return Topology == in.Topology && DepthStencilFormat == in.DepthStencilFormat && numMRT == in.numMRT; + return Topology == in.Topology && DepthStencilFormat == in.DepthStencilFormat && numMRT == in.numMRT && depthEnabled == in.depthEnabled; } }; @@ -145,6 +146,8 @@ struct D3D12Traits graphicPipelineStateDesc.RasterizerState = CD3D12_RASTERIZER_DESC; graphicPipelineStateDesc.PrimitiveTopologyType = pipelineProperties.Topology; + graphicPipelineStateDesc.DepthStencilState.DepthEnable = pipelineProperties.depthEnabled; + graphicPipelineStateDesc.NumRenderTargets = pipelineProperties.numMRT; for (unsigned i = 0; i < pipelineProperties.numMRT; i++) graphicPipelineStateDesc.RTVFormats[i] = DXGI_FORMAT_R8G8B8A8_UNORM;