File tree Expand file tree Collapse file tree 4 files changed +38
-50
lines changed Expand file tree Collapse file tree 4 files changed +38
-50
lines changed Original file line number Diff line number Diff line change @@ -115,9 +115,11 @@ bool DynamicRayManagementPass::runOnFunction(Function& F)
115
115
// 1. RayTracing is not supported on this platform.
116
116
// 2. Shader does not use RayQuery at all.
117
117
// 3. There are more than 1 exit block.
118
+ // 4. RayQuery needs splitting due to forced SIMD32
118
119
if ((m_CGCtx->platform .supportRayTracing () == false ) ||
119
120
(!m_CGCtx->hasSyncRTCalls ()) ||
120
- (getNumberOfExitBlocks (F) > 1 ))
121
+ (getNumberOfExitBlocks (F) > 1 ) ||
122
+ m_CGCtx->syncRTCallsNeedSplitting ())
121
123
{
122
124
return false ;
123
125
}
Original file line number Diff line number Diff line change @@ -1040,31 +1040,6 @@ class RTGlobalsPointerLoweringPass : public FunctionPass
1040
1040
1041
1041
char RTGlobalsPointerLoweringPass::ID = 0 ;
1042
1042
1043
- bool RTGlobalsPointerLoweringPass::needsSplitting (const CodeGenContext* Ctx)
1044
- {
1045
- // In general, we don't want to compile SIMD32 for rayquery.
1046
- // Determine if we are forced to do so.
1047
-
1048
- if (Ctx->type != ShaderType::COMPUTE_SHADER)
1049
- return false ;
1050
-
1051
- auto & csInfo = Ctx->getModuleMetaData ()->csInfo ;
1052
-
1053
- if (IGC_IS_FLAG_ENABLED (ForceCSSIMD32) ||
1054
- IGC_GET_FLAG_VALUE (ForceCSSimdSize4RQ) == 32 )
1055
- return true ;
1056
- if (IGC_IS_FLAG_ENABLED (ForceCSSIMD16))
1057
- return false ;
1058
- if (csInfo.forcedSIMDSize == 32 )
1059
- return true ;
1060
- if (csInfo.forcedSIMDSize == 16 )
1061
- return false ;
1062
- if (csInfo.waveSize == 32 )
1063
- return true ;
1064
-
1065
- return false ;
1066
- }
1067
-
1068
1043
bool RTGlobalsPointerLoweringPass::runOnFunction (Function& F)
1069
1044
{
1070
1045
m_CGCtx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext ();
@@ -1085,7 +1060,7 @@ bool RTGlobalsPointerLoweringPass::runOnFunction(Function& F)
1085
1060
IGC_ASSERT_MESSAGE (nullptr != modMD,
1086
1061
" Invalid Module Metadata in RTGlobalsPointerLoweringPass" );
1087
1062
1088
- const bool NeedsSplitting = needsSplitting ( m_CGCtx);
1063
+ const bool NeedsSplitting = m_CGCtx-> syncRTCallsNeedSplitting ( );
1089
1064
1090
1065
for (auto * GBP : globalBuffPtrs)
1091
1066
{
Original file line number Diff line number Diff line change @@ -23671,9 +23671,6 @@ void EmitPass::emitRayQueryCheckRelease(
23671
23671
23672
23672
m_encoder->Lifetime(LIFETIME_START, dummySource);
23673
23673
23674
- const uint32_t NumSend =
23675
- (m_currShader->m_SIMDSize == SIMDMode::SIMD32
23676
- ) ? 2 : 1;
23677
23674
23678
23675
CVariable* flag = nullptr;
23679
23676
@@ -23683,28 +23680,17 @@ void EmitPass::emitRayQueryCheckRelease(
23683
23680
flag = GetSymbol(I->getOperand(0));
23684
23681
}
23685
23682
23686
- for (uint32_t Cnt = 0; Cnt < NumSend; Cnt++)
23687
- {
23688
- if (m_currShader->m_SIMDSize == SIMDMode::SIMD32
23689
- )
23690
- {
23691
- m_encoder->SetSimdSize(SIMDMode::SIMD16);
23692
- if (Cnt == 1)
23693
- m_encoder->SetMask(EMASK_H2);
23694
- }
23695
-
23696
- m_encoder->SetPredicate(flag);
23683
+ m_encoder->SetPredicate(flag);
23697
23684
23698
- m_encoder->Sends(
23699
- nullptr,
23700
- header,
23701
- dummySource,
23702
- extDescriptor,
23703
- exDesc,
23704
- pMessDesc);
23685
+ m_encoder->Sends(
23686
+ nullptr,
23687
+ header,
23688
+ dummySource,
23689
+ extDescriptor,
23690
+ exDesc,
23691
+ pMessDesc);
23705
23692
23706
- m_encoder->Push();
23707
- }
23693
+ m_encoder->Push();
23708
23694
23709
23695
// Insert a software fence after the send.rta so no IO operations get
23710
23696
// scheduled across the send from below. We should be able to remove this
Original file line number Diff line number Diff line change @@ -1240,6 +1240,31 @@ namespace IGC
1240
1240
1241
1241
// For remarks
1242
1242
void initializeRemarkEmitter (const ShaderHash& hash);
1243
+
1244
+ bool syncRTCallsNeedSplitting ()
1245
+ {
1246
+ // In general, we don't want to compile SIMD32 for rayquery.
1247
+ // Determine if we are forced to do so.
1248
+
1249
+ if (type != ShaderType::COMPUTE_SHADER)
1250
+ return false ;
1251
+
1252
+ auto & csInfo = getModuleMetaData ()->csInfo ;
1253
+
1254
+ if (IGC_IS_FLAG_ENABLED (ForceCSSIMD32) ||
1255
+ IGC_GET_FLAG_VALUE (ForceCSSimdSize4RQ) == 32 )
1256
+ return true ;
1257
+ if (IGC_IS_FLAG_ENABLED (ForceCSSIMD16))
1258
+ return false ;
1259
+ if (csInfo.forcedSIMDSize == 32 )
1260
+ return true ;
1261
+ if (csInfo.forcedSIMDSize == 16 )
1262
+ return false ;
1263
+ if (csInfo.waveSize == 32 )
1264
+ return true ;
1265
+
1266
+ return false ;
1267
+ }
1243
1268
};
1244
1269
1245
1270
struct SComputeShaderSecondCompileInput
You can’t perform that action at this time.
0 commit comments