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
This commit is contained in:
Jake Turner
2025-12-03 11:20:23 +13:00
parent abbe6d128a
commit 728ac77bf3
2 changed files with 0 additions and 8 deletions
@@ -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);
}
-4
View File
@@ -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);
}