Skip to content

Commit db13dba

Browse files
mmereckisys_zuul
authored andcommitted
Fix ordering of dual-source RTW messages. HW requires dual-source message to be sent before the single-source message. This ordering was not always correct when shader had KillPix.
Change-Id: I851ddbf45a67b4d8cc4d3a9a25e8951e1de512a8
1 parent e1abe84 commit db13dba

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

IGC/Compiler/CISACodeGen/PixelShaderLowering.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,8 +1252,20 @@ namespace IGC
12521252

12531253
if (useDualSrcBlend(colors))
12541254
{
1255-
moveRTWriteToBlock(colors[0].inst, predBB, m_ReturnBlock, valueToPhiMap);
1256-
moveRTWriteToBlock(colors[1].inst, predBB, m_ReturnBlock, valueToPhiMap);
1255+
// For SIMD16 PS thread with two output colors must send
1256+
// messages in the following sequence for each RT: SIMD8 dual
1257+
// source RTW message (low); SIMD8 dual source RTW message
1258+
// (high); SIMD16 single src RTW message with second color.
1259+
CallInst* const dualSourceRTW =
1260+
isa<RTDualBlendSourceIntrinsic>(colors[0].inst) ? colors[0].inst : colors[1].inst;
1261+
CallInst* const singleSourceRTW =
1262+
isa<RTDualBlendSourceIntrinsic>(colors[0].inst) ? colors[1].inst : colors[0].inst;
1263+
1264+
assert(isa<RTWritIntrinsic>(singleSourceRTW));
1265+
assert(isa<RTDualBlendSourceIntrinsic>(dualSourceRTW));
1266+
1267+
moveRTWriteToBlock(dualSourceRTW, predBB, m_ReturnBlock, valueToPhiMap);
1268+
moveRTWriteToBlock(singleSourceRTW, predBB, m_ReturnBlock, valueToPhiMap);
12571269
}
12581270
else
12591271
{

0 commit comments

Comments
 (0)