mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-23 14:15:42 +00:00
Don't duplicate workgroup for derivatives
* Because SPIR-V is SSA, we can use the current workgroup for all cross-group operations, knowing that the output ID of any such opcode can't also be the input (so doing workgroup operations one-at-a-time is still fine, we won't corrupt results of later threads by updating earlier ones.
This commit is contained in:
@@ -590,10 +590,6 @@ rdcarray<ShaderDebugState> Debugger::ContinueDebug()
|
||||
if(active.Finished())
|
||||
return ret;
|
||||
|
||||
rdcarray<DenseIdMap<ShaderVariable>> oldworkgroup;
|
||||
|
||||
oldworkgroup.resize(workgroup.size());
|
||||
|
||||
rdcarray<bool> activeMask;
|
||||
|
||||
// do 100 in a chunk
|
||||
@@ -602,12 +598,6 @@ rdcarray<ShaderDebugState> Debugger::ContinueDebug()
|
||||
if(active.Finished())
|
||||
break;
|
||||
|
||||
// set up the old workgroup so that cross-workgroup/cross-quad operations (e.g. DDX/DDY) get
|
||||
// consistent results even when we step the quad out of order. Otherwise if an operation reads
|
||||
// and writes from the same register we'd trash data needed for other workgroup elements.
|
||||
for(size_t i = 0; i < oldworkgroup.size(); i++)
|
||||
oldworkgroup[i] = workgroup[i].ids;
|
||||
|
||||
// calculate the current mask of which threads are active
|
||||
CalcActiveMask(activeMask);
|
||||
|
||||
@@ -653,7 +643,7 @@ rdcarray<ShaderDebugState> Debugger::ContinueDebug()
|
||||
l++;
|
||||
}
|
||||
|
||||
thread.StepNext(&state, oldworkgroup);
|
||||
thread.StepNext(&state, workgroup);
|
||||
state.stepIndex = steps;
|
||||
state.sourceVars = thread.sourceVars;
|
||||
thread.FillCallstack(state);
|
||||
@@ -661,7 +651,7 @@ rdcarray<ShaderDebugState> Debugger::ContinueDebug()
|
||||
}
|
||||
else
|
||||
{
|
||||
thread.StepNext(NULL, oldworkgroup);
|
||||
thread.StepNext(NULL, workgroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user