mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-14 10:21:21 +00:00
d3d12: Fix depth format mismatch
This commit is contained in:
parent
e6146e4ecb
commit
740354d2c9
@ -758,6 +758,22 @@ bool D3D12GSRender::LoadProgram()
|
||||
// checkForGlError("glBlendColor");
|
||||
}
|
||||
|
||||
switch (m_surface_depth_format)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case CELL_GCM_SURFACE_Z16:
|
||||
prop.DepthStencilFormat = DXGI_FORMAT_D16_UNORM;
|
||||
break;
|
||||
case CELL_GCM_SURFACE_Z24S8:
|
||||
prop.DepthStencilFormat = DXGI_FORMAT_D24_UNORM_S8_UINT;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR(RSX, "Bad depth format! (%d)", m_surface_depth_format);
|
||||
assert(0);
|
||||
}
|
||||
;
|
||||
|
||||
prop.IASet = m_IASet;
|
||||
|
||||
|
||||
|
@ -13,13 +13,14 @@
|
||||
struct D3D12PipelineProperties
|
||||
{
|
||||
D3D12_PRIMITIVE_TOPOLOGY_TYPE Topology;
|
||||
DXGI_FORMAT DepthStencilFormat;
|
||||
std::vector<D3D12_INPUT_ELEMENT_DESC> IASet;
|
||||
D3D12_BLEND_DESC Blend;
|
||||
|
||||
bool operator==(const D3D12PipelineProperties &in) const
|
||||
{
|
||||
// TODO: blend and IASet equality
|
||||
return Topology == in.Topology;
|
||||
return Topology == in.Topology && DepthStencilFormat == in.DepthStencilFormat;
|
||||
}
|
||||
};
|
||||
|
||||
@ -145,7 +146,7 @@ struct D3D12Traits
|
||||
|
||||
graphicPipelineStateDesc.NumRenderTargets = 1;
|
||||
graphicPipelineStateDesc.RTVFormats[0] = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
graphicPipelineStateDesc.DSVFormat = DXGI_FORMAT_D16_UNORM;
|
||||
graphicPipelineStateDesc.DSVFormat = pipelineProperties.DepthStencilFormat;
|
||||
|
||||
graphicPipelineStateDesc.InputLayout.pInputElementDescs = pipelineProperties.IASet.data();
|
||||
graphicPipelineStateDesc.InputLayout.NumElements = (UINT)pipelineProperties.IASet.size();
|
||||
|
Loading…
x
Reference in New Issue
Block a user