Skip to content

Commit e83809f

Browse files
skarczewigcbot
authored andcommitted
Handle more than one GRF for one input.
Handle more than one GRF for one input.
1 parent 6bfc667 commit e83809f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

IGC/Compiler/CISACodeGen/PushAnalysis.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,14 +1380,15 @@ namespace IGC
13801380
int urbReadOffsetForPush = 0;
13811381

13821382

1383-
bool pushCondition = ((urbOffset >= urbReadOffsetForPush) && (urbOffset - urbReadOffsetForPush) < (int)numberOfElementsPerVertexThatAreGoingToBePushed);
1383+
bool pushCondition = ((urbOffset >= urbReadOffsetForPush) && ((urbOffset - urbReadOffsetForPush) < (int)numberOfElementsPerVertexThatAreGoingToBePushed));
13841384

13851385
// If the attribute index of URBRead is a constant then we pull
13861386
// inputs if elementIndex <= numberOfElementsPerVertexThatAreGoingToBePushed
13871387
if (pElementIndex && pushCondition)
13881388
{
1389-
uint elementIndex = urbOffset - urbReadOffsetForPush;
1390-
uint currentElementIndex = (vertexIndex * numberOfElementsPerVertexThatAreGoingToBePushed * 4) + (elementIndex * 4);
1389+
uint lanesPerElement = 1;
1390+
uint elementIndex = urbOffset * lanesPerElement - urbReadOffsetForPush;
1391+
uint currentElementIndex = (vertexIndex * numberOfElementsPerVertexThatAreGoingToBePushed * 4 * lanesPerElement) + (elementIndex * 4);
13911392

13921393
for (auto I = inst->user_begin(), E = inst->user_end(); I != E; ++I)
13931394
{

0 commit comments

Comments
 (0)