D3D12: Fix crash/errors when switching MSAA modes while running

This commit is contained in:
Stenzek
2016-02-21 18:55:55 +10:00
parent 1d909ec7a4
commit 9efe66509d
3 changed files with 28 additions and 4 deletions

View File

@ -95,6 +95,9 @@ public:
HRESULT GetPipelineStateObjectFromCache(D3D12_GRAPHICS_PIPELINE_STATE_DESC* pso_desc, ID3D12PipelineState** pso);
HRESULT GetPipelineStateObjectFromCache(SmallPsoDesc* pso_desc, ID3D12PipelineState** pso, D3D12_PRIMITIVE_TOPOLOGY_TYPE topology, const GeometryShaderUid* gs_uid, const PixelShaderUid* ps_uid, const VertexShaderUid* vs_uid);
// Called when the MSAA count/quality changes. Invalidates all small PSOs.
void OnMSAASettingsChanged();
// Release all cached states and clear hash tables.
void Clear();
@ -126,7 +129,8 @@ private:
lhs.BlendState.RenderTarget[0].DestBlend,
lhs.BlendState.RenderTarget[0].SrcBlend,
lhs.BlendState.RenderTarget[0].RenderTargetWriteMask,
lhs.RTVFormats[0]) ==
lhs.RTVFormats[0],
lhs.SampleDesc.Count) ==
std::tie(rhs.PS.pShaderBytecode, rhs.VS.pShaderBytecode, rhs.GS.pShaderBytecode,
rhs.RasterizerState.CullMode,
rhs.DepthStencilState.DepthEnable,
@ -137,7 +141,8 @@ private:
rhs.BlendState.RenderTarget[0].DestBlend,
rhs.BlendState.RenderTarget[0].SrcBlend,
rhs.BlendState.RenderTarget[0].RenderTargetWriteMask,
rhs.RTVFormats[0]);
rhs.RTVFormats[0],
rhs.SampleDesc.Count);
}
};