DXOp::WaveIsFirstLane considers helper lanes as active

This commit is contained in:
Jake Turner
2025-10-04 14:01:54 +01:00
parent 7b146ec97d
commit 02f08bb051
+12 -1
View File
@@ -3914,7 +3914,18 @@ bool ThreadState::ExecuteInstruction(const rdcarray<ThreadState> &workgroup)
{
// determine active lane indices in our subgroup
rdcarray<uint32_t> activeLanes;
GetSubgroupActiveLanes(workgroup, activeLanes);
const uint32_t firstLaneInSub = m_WorkgroupIndex - m_SubgroupIdx;
for(uint32_t lane = firstLaneInSub; lane < firstLaneInSub + m_GlobalState.subgroupSize;
lane++)
{
RDCASSERT(lane < m_ActiveMask.size(), lane, m_ActiveMask.size());
// helper lanes are considered active for this instruction
if(m_ActiveMask[lane])
{
RDCASSERT(lane < workgroup.size(), lane, workgroup.size());
activeLanes.push_back(lane);
}
}
RDCASSERT(!SubgroupIsDiverged(workgroup, activeLanes));
result.value.u32v[0] = (m_WorkgroupIndex == activeLanes[0]) ? 1 : 0;
break;