D3D12: Fix out of bounds root parameter index when per-pixel lighting is disabled

This commit is contained in:
Pokechu22
2025-01-14 22:00:46 -08:00
parent 3ea870ef8c
commit 64514bd8d4
3 changed files with 7 additions and 8 deletions

View File

@ -370,6 +370,9 @@ bool DXContext::CreateGXRootSignature()
SetRootParamConstant(&params[param_count], 4, 1, D3D12_SHADER_VISIBILITY_VERTEX);
param_count++;
SetRootParamCBV(&params[param_count], 2, D3D12_SHADER_VISIBILITY_PIXEL);
param_count++;
// Since these must be contiguous, pixel lighting goes to bbox if not enabled.
if (g_ActiveConfig.bBBoxEnable)
{
@ -383,9 +386,6 @@ bool DXContext::CreateGXRootSignature()
param_count++;
}
SetRootParamCBV(&params[param_count], 2, D3D12_SHADER_VISIBILITY_PIXEL);
param_count++;
return BuildRootSignature(m_device.Get(), &m_gx_root_signature, params.data(), param_count);
}