Skip to content

Commit 7bbf209

Browse files
jaladreipsigcbot
authored andcommitted
Do not insert check/release intriniscs if shader has discards
Do not insert check/release intriniscs if shader has discards
1 parent 44afb94 commit 7bbf209

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

IGC/AdaptorCommon/RayTracing/DynamicRayManagementPass.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,24 @@ bool DynamicRayManagementPass::runOnFunction(Function& F)
115115

116116
bool changed = false;
117117

118+
bool hasDiscard = llvm::any_of(
119+
instructions(F),
120+
[](auto& I) {
121+
return isDiscardInstruction(&I);
122+
}
123+
);
124+
118125
// Dot not process further if:
119126
// 1. RayTracing is not supported on this platform.
120127
// 2. Shader does not use RayQuery at all.
121128
// 3. There are more than 1 exit block.
122129
// 4. RayQuery needs splitting due to forced SIMD32
130+
// 5. Shader has discards
123131
if ((m_CGCtx->platform.supportRayTracing() == false) ||
124132
(!m_CGCtx->hasSyncRTCalls()) ||
125133
(getNumberOfExitBlocks(F) > 1) ||
126-
m_CGCtx->syncRTCallsNeedSplitting())
134+
m_CGCtx->syncRTCallsNeedSplitting() ||
135+
hasDiscard)
127136
{
128137
return false;
129138
}

0 commit comments

Comments
 (0)