@@ -3701,8 +3701,6 @@ class HLSLExternalSource : public ExternalSemaSource {
37013701 const auto *SM =
37023702 hlsl::ShaderModel::GetByName(m_sema->getLangOpts().HLSLProfile.c_str());
37033703 CXXRecordDecl *nodeOutputDecl = nullptr, *emptyNodeOutputDecl = nullptr;
3704- const bool EnableSER =
3705- m_sema->getLangOpts().EnableShaderExecutionReordering;
37063704
37073705 for (unsigned i = 0; i < _countof(g_ArBasicKindsAsTypes); i++) {
37083706 ArBasicKind kind = g_ArBasicKindsAsTypes[i];
@@ -3779,7 +3777,7 @@ class HLSLExternalSource : public ExternalSemaSource {
37793777 recordDecl = DeclareRayQueryType(*m_context);
37803778 } else if (kind == AR_OBJECT_HIT_OBJECT) {
37813779 // Declare 'HitObject' in '::dx' extension namespace.
3782- if (EnableSER ) {
3780+ if (SM->IsSM69Plus() ) {
37833781 DXASSERT(m_dxNSDecl, "namespace ::dx must be declared in SM6.9+");
37843782 recordDecl = DeclareHitObjectType(*m_dxNSDecl);
37853783 }
@@ -5084,13 +5082,13 @@ class HLSLExternalSource : public ExternalSemaSource {
50845082 }
50855083
50865084 bool IsEnabledIntrinsic(const HLSL_INTRINSIC *pIntrinsic,
5087- const LangOptions LangOpts ) {
5085+ const ShaderModel &SM ) {
50885086 switch ((IntrinsicOp)pIntrinsic->Op) {
50895087 default:
50905088 return true;
50915089 case IntrinsicOp::MOP_DxHitObject_MakeNop:
50925090 case IntrinsicOp::IOP_DxMaybeReorderThread:
5093- return LangOpts.EnableShaderExecutionReordering ;
5091+ return SM.IsSM69Plus() ;
50945092 }
50955093 }
50965094
@@ -5147,6 +5145,9 @@ class HLSLExternalSource : public ExternalSemaSource {
51475145 }
51485146#endif // ENABLE_SPIRV_CODEGEN
51495147
5148+ const auto *SM =
5149+ hlsl::ShaderModel::GetByName(m_sema->getLangOpts().HLSLProfile.c_str());
5150+
51505151 IntrinsicDefIter cursor = FindIntrinsicByNameAndArgCount(
51515152 table, tableCount, StringRef(), nameIdentifier, Args.size());
51525153 IntrinsicDefIter end = IntrinsicDefIter::CreateEnd(
@@ -5159,7 +5160,7 @@ class HLSLExternalSource : public ExternalSemaSource {
51595160 // configuration. Note that this not necessary for member functions:
51605161 // if the builtin type is never declared, neither will any type refer
51615162 // to the member intrinsics table.
5162- if (!IsEnabledIntrinsic(*cursor, m_sema->getLangOpts() ))
5163+ if (!IsEnabledIntrinsic(*cursor, *SM ))
51635164 continue;
51645165
51655166 // If this is the intrinsic we're interested in, build up a representation
@@ -11935,7 +11936,7 @@ void Sema::DiagnoseReachableCallForSER(CallExpr *CE, DXIL::ShaderKind EntrySK,
1193511936 Diag(EntryFD->getLocation(), diag::note_hlsl_entry_defined_here);
1193611937 }
1193711938
11938- if (!getLangOpts().EnableShaderExecutionReordering ) {
11939+ if (!SM->IsSM69Plus() ) {
1193911940 // Legal entry, but version not supported
1194011941 Diag(Loc, diag::err_hlsl_ser_invalid_version) << SM->GetName();
1194111942 }
0 commit comments