From 728ac77bf332deebf76ca1c4ce3121fde86ddc0a Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Wed, 3 Dec 2025 08:52:23 +1300 Subject: [PATCH] Fix D3D12 debug error when setting constants in EI For instance would trigger when setting a single 32-bit root constant Do not need to call resize_for_index() on constants because SetConstants() will handle any resizing that is required --- renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp | 4 ---- renderdoc/driver/d3d12/d3d12_state.cpp | 4 ---- 2 files changed, 8 deletions(-) diff --git a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp index af5f86b8b..cfcb06c18 100644 --- a/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_list_wrap.cpp @@ -3952,16 +3952,12 @@ void WrappedID3D12GraphicsCommandList::FinaliseExecuteIndirectEvents(BakedCmdLis if(arg.Constant.RootParameterIndex < state.graphics.sigelems.size()) { - state.graphics.sigelems[arg.Constant.RootParameterIndex].constants.resize_for_index( - arg.Constant.Num32BitValuesToSet + arg.Constant.DestOffsetIn32BitValues); state.graphics.sigelems[arg.Constant.RootParameterIndex].SetConstants( arg.Constant.Num32BitValuesToSet, data32, arg.Constant.DestOffsetIn32BitValues); } if(arg.Constant.RootParameterIndex < state.compute.sigelems.size()) { - state.compute.sigelems[arg.Constant.RootParameterIndex].constants.resize_for_index( - arg.Constant.Num32BitValuesToSet + arg.Constant.DestOffsetIn32BitValues); state.compute.sigelems[arg.Constant.RootParameterIndex].SetConstants( arg.Constant.Num32BitValuesToSet, data32, arg.Constant.DestOffsetIn32BitValues); } diff --git a/renderdoc/driver/d3d12/d3d12_state.cpp b/renderdoc/driver/d3d12/d3d12_state.cpp index 24fb89d83..70d9676ea 100644 --- a/renderdoc/driver/d3d12/d3d12_state.cpp +++ b/renderdoc/driver/d3d12/d3d12_state.cpp @@ -110,16 +110,12 @@ void D3D12RenderState::ResolvePendingIndirectState(WrappedID3D12Device *device) if(comSig->sig.graphics) { graphics.sigelems.resize_for_index(arg.Constant.RootParameterIndex); - graphics.sigelems[arg.Constant.RootParameterIndex].constants.resize_for_index( - arg.Constant.Num32BitValuesToSet + arg.Constant.DestOffsetIn32BitValues); graphics.sigelems[arg.Constant.RootParameterIndex].SetConstants( arg.Constant.Num32BitValuesToSet, data32, arg.Constant.DestOffsetIn32BitValues); } else { compute.sigelems.resize_for_index(arg.Constant.RootParameterIndex); - compute.sigelems[arg.Constant.RootParameterIndex].constants.resize_for_index( - arg.Constant.Num32BitValuesToSet + arg.Constant.DestOffsetIn32BitValues); compute.sigelems[arg.Constant.RootParameterIndex].SetConstants( arg.Constant.Num32BitValuesToSet, data32, arg.Constant.DestOffsetIn32BitValues); }