Fix handling of out-of-bounds raw buffer loads in DXBC debug

This commit is contained in:
baldurk
2025-02-25 12:35:11 +00:00
parent 81268dc79a
commit 2c67e87c17
+4 -3
View File
@@ -3510,9 +3510,10 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper,
fmt.numComps = 4;
// clamp to out of bounds based on numElems
fmt.numComps = RDCMIN(fmt.numComps, int(numElems - elemIdx) / 4);
int boundsClampedComps = int(numElems - elemIdx) / 4;
fmt.numComps = RDCMIN(fmt.numComps, boundsClampedComps);
for(int c = 0; c < 4; c++)
for(int c = 0; c < boundsClampedComps; c++)
{
if(c < fmt.numComps)
RDCASSERTEQUAL(op.operands[0].comps[c], c);
@@ -3530,7 +3531,7 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper,
// apply the swizzle on the resource operand
ShaderVariable fetch("", 0U, 0U, 0U, 0U);
for(int c = 0; c < 4; c++)
for(int c = 0; c < fmt.numComps; c++)
{
uint8_t comp = resComps[c];
if(comp == 0xff)