From 2113e360a2cba8a36d6d018190c59d946c5913a7 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Thu, 12 Nov 2026 16:15:04 +0000 Subject: [PATCH] Share D3D12 Loading & Replay code per API: CommandList8 APIs - Serialise_OMSetFrontAndBackStencilRef --- .../driver/d3d12/d3d12_command_list8_wrap.cpp | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/renderdoc/driver/d3d12/d3d12_command_list8_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list8_wrap.cpp index 7ee0aba48..0fc6ee4c0 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list8_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list8_wrap.cpp @@ -49,24 +49,18 @@ bool WrappedID3D12GraphicsCommandList::Serialise_OMSetFrontAndBackStencilRef(Ser bool stateUpdate = false; - if(IsActiveReplaying(m_State)) + if(m_Cmd->InRerecordRange(m_Cmd->m_LastCmdListID)) { - if(m_Cmd->InRerecordRange(m_Cmd->m_LastCmdListID)) - { - Unwrap8(m_Cmd->RerecordCmdList(m_Cmd->m_LastCmdListID)) - ->OMSetFrontAndBackStencilRef(FrontStencilRef, BackStencilRef); + bool loading = IsLoading(m_State); + ID3D12GraphicsCommandListX *list = !loading ? m_Cmd->RerecordCmdList(m_Cmd->m_LastCmdListID) + : (ID3D12GraphicsCommandListX *)pCommandList; - stateUpdate = true; - } - else if(!m_Cmd->IsPartialCmdList(m_Cmd->m_LastCmdListID)) - { - stateUpdate = true; - } + Unwrap8(list)->OMSetFrontAndBackStencilRef(FrontStencilRef, BackStencilRef); + + stateUpdate = true; } - else + else if(!m_Cmd->IsPartialCmdList(m_Cmd->m_LastCmdListID)) { - Unwrap8(pCommandList)->OMSetFrontAndBackStencilRef(FrontStencilRef, BackStencilRef); - stateUpdate = true; }