From 4dea565a61bf4b0942eb3967f2ba93250e1f0317 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 10 Sep 2018 10:48:35 +0100 Subject: [PATCH] Only check for D3D12 replay features when actually replaying * This means structured export can still happen even without any D3D12 support at all. --- .../driver/d3d12/d3d12_command_list1_wrap.cpp | 108 +++++++++--------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/renderdoc/driver/d3d12/d3d12_command_list1_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list1_wrap.cpp index cb22429c9..c9907a4f9 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list1_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list1_wrap.cpp @@ -45,14 +45,14 @@ bool WrappedID3D12GraphicsCommandList2::Serialise_AtomicCopyBufferUINT( SERIALISE_CHECK_READ_ERRORS(); - if(GetWrapped(pCommandList)->GetReal1() == NULL) - { - RDCERR("Can't replay ID3D12GraphicsCommandList1 command"); - return false; - } - if(IsReplayingAndReading()) { + if(GetWrapped(pCommandList)->GetReal1() == NULL) + { + RDCERR("Can't replay ID3D12GraphicsCommandList1 command"); + return false; + } + m_Cmd->m_LastCmdListID = GetResourceManager()->GetOriginalID(GetResID(pCommandList)); if(IsActiveReplaying(m_State)) @@ -163,14 +163,14 @@ bool WrappedID3D12GraphicsCommandList2::Serialise_AtomicCopyBufferUINT64( SERIALISE_CHECK_READ_ERRORS(); - if(GetWrapped(pCommandList)->GetReal1() == NULL) - { - RDCERR("Can't replay ID3D12GraphicsCommandList1 command"); - return false; - } - if(IsReplayingAndReading()) { + if(GetWrapped(pCommandList)->GetReal1() == NULL) + { + RDCERR("Can't replay ID3D12GraphicsCommandList1 command"); + return false; + } + m_Cmd->m_LastCmdListID = GetResourceManager()->GetOriginalID(GetResID(pCommandList)); if(IsActiveReplaying(m_State)) @@ -274,20 +274,20 @@ bool WrappedID3D12GraphicsCommandList2::Serialise_OMSetDepthBounds(SerialiserTyp SERIALISE_CHECK_READ_ERRORS(); - if(GetWrapped(pCommandList)->GetReal1() == NULL) - { - RDCERR("Can't replay ID3D12GraphicsCommandList1 command"); - return false; - } - - if(m_pDevice->GetOpts2().DepthBoundsTestSupported == 0) - { - RDCERR("Can't replay OMSetDepthBounds without device support"); - return false; - } - if(IsReplayingAndReading()) { + if(GetWrapped(pCommandList)->GetReal1() == NULL) + { + RDCERR("Can't replay ID3D12GraphicsCommandList1 command"); + return false; + } + + if(m_pDevice->GetOpts2().DepthBoundsTestSupported == 0) + { + RDCERR("Can't replay OMSetDepthBounds without device support"); + return false; + } + m_Cmd->m_LastCmdListID = GetResourceManager()->GetOriginalID(GetResID(pCommandList)); if(IsActiveReplaying(m_State)) @@ -343,14 +343,14 @@ bool WrappedID3D12GraphicsCommandList2::Serialise_SetSamplePositions( SERIALISE_CHECK_READ_ERRORS(); - if(GetWrapped(pCommandList)->GetReal1() == NULL) - { - RDCERR("Can't replay ID3D12GraphicsCommandList1 command"); - return false; - } - if(IsReplayingAndReading()) { + if(GetWrapped(pCommandList)->GetReal1() == NULL) + { + RDCERR("Can't replay ID3D12GraphicsCommandList1 command"); + return false; + } + m_Cmd->m_LastCmdListID = GetResourceManager()->GetOriginalID(GetResID(pCommandList)); if(IsActiveReplaying(m_State)) @@ -429,14 +429,14 @@ bool WrappedID3D12GraphicsCommandList2::Serialise_ResolveSubresourceRegion( SERIALISE_CHECK_READ_ERRORS(); - if(GetWrapped(pCommandList)->GetReal1() == NULL) - { - RDCERR("Can't replay ID3D12GraphicsCommandList1 command"); - return false; - } - if(IsReplayingAndReading()) { + if(GetWrapped(pCommandList)->GetReal1() == NULL) + { + RDCERR("Can't replay ID3D12GraphicsCommandList1 command"); + return false; + } + m_Cmd->m_LastCmdListID = GetResourceManager()->GetOriginalID(GetResID(pCommandList)); if(IsActiveReplaying(m_State)) @@ -526,20 +526,20 @@ bool WrappedID3D12GraphicsCommandList2::Serialise_SetViewInstanceMask(Serialiser SERIALISE_CHECK_READ_ERRORS(); - if(GetWrapped(pCommandList)->GetReal1() == NULL) - { - RDCERR("Can't replay ID3D12GraphicsCommandList1 command"); - return false; - } - - if(m_pDevice->GetOpts3().ViewInstancingTier == D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED) - { - RDCERR("Can't replay SetViewInstanceMask without device support"); - return false; - } - if(IsReplayingAndReading()) { + if(GetWrapped(pCommandList)->GetReal1() == NULL) + { + RDCERR("Can't replay ID3D12GraphicsCommandList1 command"); + return false; + } + + if(m_pDevice->GetOpts3().ViewInstancingTier == D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED) + { + RDCERR("Can't replay SetViewInstanceMask without device support"); + return false; + } + m_Cmd->m_LastCmdListID = GetResourceManager()->GetOriginalID(GetResID(pCommandList)); if(IsActiveReplaying(m_State)) @@ -594,14 +594,14 @@ bool WrappedID3D12GraphicsCommandList2::Serialise_WriteBufferImmediate( SERIALISE_CHECK_READ_ERRORS(); - if(GetWrapped(pCommandList)->GetReal2() == NULL) - { - RDCERR("Can't replay ID3D12GraphicsCommandList2 command"); - return false; - } - if(IsReplayingAndReading()) { + if(GetWrapped(pCommandList)->GetReal2() == NULL) + { + RDCERR("Can't replay ID3D12GraphicsCommandList2 command"); + return false; + } + m_Cmd->m_LastCmdListID = GetResourceManager()->GetOriginalID(GetResID(pCommandList)); if(IsActiveReplaying(m_State))