Fix D3D11 overlays not displaying due to overwritten renderstate

This commit is contained in:
baldurk
2021-09-29 13:54:32 +01:00
parent 25b17c8093
commit 5486bf09b3
3 changed files with 7 additions and 4 deletions
+2 -4
View File
@@ -69,11 +69,9 @@ static void SetRTVDesc(D3D11_RENDER_TARGET_VIEW_DESC &rtDesc, const D3D11_TEXTUR
RenderOutputSubresource D3D11Replay::GetRenderOutputSubresource(ResourceId id)
{
D3D11RenderState *rs = m_pDevice->GetImmediateContext()->GetCurrentPipelineState();
for(size_t i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++)
{
ID3D11RenderTargetView *rtv = rs->OM.RenderTargets[i];
ID3D11RenderTargetView *rtv = m_RenderStateOM.RenderTargets[i];
ID3D11Resource *res = NULL;
if(rtv)
{
@@ -92,7 +90,7 @@ RenderOutputSubresource D3D11Replay::GetRenderOutputSubresource(ResourceId id)
}
{
ID3D11DepthStencilView *dsv = rs->OM.DepthView;
ID3D11DepthStencilView *dsv = m_RenderStateOM.DepthView;
ID3D11Resource *res = NULL;
if(dsv)
{
+2
View File
@@ -713,6 +713,8 @@ void D3D11Replay::SavePipelineState(uint32_t eventId)
D3D11RenderState *rs = m_pDevice->GetImmediateContext()->GetCurrentPipelineState();
m_RenderStateOM = rs->OM;
D3D11Pipe::State &ret = *m_D3D11PipelineState;
/////////////////////////////////////////////////
+3
View File
@@ -494,4 +494,7 @@ private:
FrameRecord m_FrameRecord;
D3D11Pipe::State *m_D3D11PipelineState = NULL;
// save the clean replay-time render state OM to check against
D3D11RenderState::OutputMerger m_RenderStateOM;
};