Skip to content

Commit 46a768b

Browse files
committed
[ser] Remove SER from LangOpts and check for SM6.9+ instead
1 parent 3d37390 commit 46a768b

6 files changed

Lines changed: 8 additions & 18 deletions

File tree

include/dxc/Support/HLSLOptions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ class DxcOpts {
249249
bool PrintAfterAll; // OPT_print_after_all
250250
std::set<std::string> PrintAfter; // OPT_print_after
251251
bool EnablePayloadQualifiers = false; // OPT_enable_payload_qualifiers
252-
bool EnableShaderExecutionReordering = false;
253252
bool HandleExceptions = false; // OPT_disable_exception_handling
254253

255254
// Rewriter Options

lib/DxcSupport/HLSLOptions.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,9 +904,6 @@ int ReadDxcOpts(const OptTable *optionTable, unsigned flagsToInclude,
904904
return 1;
905905
}
906906

907-
opts.EnableShaderExecutionReordering =
908-
DXIL::CompareVersions(Major, Minor, 6, 9) >= 0;
909-
910907
opts.HandleExceptions =
911908
!Args.hasFlag(OPT_disable_exception_handling, OPT_INVALID, false);
912909

tools/clang/include/clang/Basic/LangOptions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ class LangOptions : public LangOptionsBase {
162162
bool EnableDX9CompatMode = false;
163163
bool EnableFXCCompatMode = false;
164164
bool EnablePayloadAccessQualifiers = false;
165-
bool EnableShaderExecutionReordering = false;
166165
bool DumpImplicitTopLevelDecls = true;
167166
bool ExportShadersOnly = false;
168167
hlsl::DXIL::DefaultLinkage DefaultLinkage =

tools/clang/include/clang/Frontend/CodeGenOptions.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,6 @@ class CodeGenOptions : public CodeGenOptionsBase {
244244
bool HLSLEnableLifetimeMarkers = false;
245245
/// Put shader sources and options in the module
246246
bool HLSLEmbedSourcesInModule = false;
247-
/// Enable Shader Execution Reordering.
248-
bool HLSLEnableShaderExecutionReordering = false;
249247
/// Enable generation of payload access qualifier metadata.
250248
bool HLSLEnablePayloadAccessQualifiers = false;
251249
/// Binding table for HLSL resources

tools/clang/lib/Sema/SemaHLSL.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

tools/clang/tools/dxcompiler/dxcompilerobj.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,8 +1530,6 @@ class DxcCompiler : public IDxcCompiler3,
15301530

15311531
compiler.getLangOpts().EnablePayloadAccessQualifiers =
15321532
Opts.EnablePayloadQualifiers;
1533-
compiler.getLangOpts().EnableShaderExecutionReordering =
1534-
Opts.EnableShaderExecutionReordering;
15351533
compiler.getLangOpts().HLSLProfile = compiler.getCodeGenOpts().HLSLProfile =
15361534
Opts.TargetProfile;
15371535
const ShaderModel *SM = hlsl::ShaderModel::GetByName(
@@ -1629,8 +1627,6 @@ class DxcCompiler : public IDxcCompiler3,
16291627
Opts.EnableLifetimeMarkers;
16301628
compiler.getCodeGenOpts().HLSLEnablePayloadAccessQualifiers =
16311629
Opts.EnablePayloadQualifiers;
1632-
compiler.getCodeGenOpts().HLSLEnableShaderExecutionReordering =
1633-
Opts.EnableShaderExecutionReordering;
16341630

16351631
// Translate signature packing options
16361632
if (Opts.PackPrefixStable)

0 commit comments

Comments
 (0)