Skip to content

Commit

Permalink
DXIL Debugger improve the detection of when threads are diverged
Browse files Browse the repository at this point in the history
Discount threads which have finished which could include helper threads which have called discard
  • Loading branch information
Zorro666 committed Nov 26, 2024
1 parent bca09b1 commit 39eb3f1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions renderdoc/driver/shaders/dxil/dxil_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4933,10 +4933,18 @@ GlobalState::~GlobalState()

bool ThreadState::ThreadsAreDiverged(const rdcarray<ThreadState> &workgroups)
{
const uint32_t block0 = workgroups[0].m_Block;
const uint32_t instr0 = workgroups[0].m_ActiveGlobalInstructionIdx;
for(size_t i = 1; i < workgroups.size(); i++)
uint32_t block0 = ~0U;
uint32_t instr0 = ~0U;
for(size_t i = 0; i < workgroups.size(); i++)
{
if(workgroups[i].Finished())
continue;
if(block0 == ~0U)
{
block0 = workgroups[i].m_Block;
instr0 = workgroups[i].m_ActiveGlobalInstructionIdx;
continue;
}
// not in the same basic block
if(workgroups[i].m_Block != block0)
return true;
Expand Down

0 comments on commit 39eb3f1

Please sign in to comment.