Skip to content

Commit 4d1d99c

Browse files
committed
review: use -force-rootsig-ver for clang-dxc
1 parent 36783a4 commit 4d1d99c

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9291,12 +9291,20 @@ def enable_16bit_types : DXCFlag<"enable-16bit-types">, Alias<fnative_half_type>
92919291
def hlsl_rootsig_ver :
92929292
Option<["-"], "hlsl-rootsig-ver", KIND_SEPARATE>,
92939293
Group<dxc_Group>,
9294-
Visibility<[ClangOption, CC1Option, DXCOption]>,
9294+
Visibility<[ClangOption, CC1Option]>,
92959295
HelpText<"Root Signature Version">,
92969296
Values<"rootsig_1_0,rootsig_1_1">,
92979297
NormalizedValuesScope<"llvm::dxbc::RootSignatureVersion">,
92989298
NormalizedValues<["V1_0", "V1_1"]>,
92999299
MarshallingInfoEnum<LangOpts<"HLSLRootSigVer">, "V1_1">;
9300+
def dxc_rootsig_ver :
9301+
Option<["-"], "force-rootsig-ver", KIND_SEPARATE>,
9302+
Group<dxc_Group>,
9303+
Visibility<[ClangOption, CC1Option, DXCOption]>,
9304+
HelpText<"Root Signature Version">,
9305+
Values<"rootsig_1_0,rootsig_1_1">,
9306+
NormalizedValuesScope<"llvm::dxbc::RootSignatureVersion">,
9307+
NormalizedValues<["V1_0", "V1_1"]>;
93009308
def hlsl_entrypoint : Option<["-"], "hlsl-entry", KIND_SEPARATE>,
93019309
Group<dxc_Group>,
93029310
Visibility<[ClangOption, CC1Option]>,

clang/lib/Driver/ToolChains/HLSL.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,12 @@ HLSLToolChain::TranslateArgs(const DerivedArgList &Args, StringRef BoundArch,
295295
A->claim();
296296
continue;
297297
}
298+
if (A->getOption().getID() == options::OPT_dxc_rootsig_ver) {
299+
DAL->AddSeparateArg(nullptr, Opts.getOption(options::OPT_hlsl_rootsig_ver),
300+
A->getValue());
301+
A->claim();
302+
continue;
303+
}
298304
if (A->getOption().getID() == options::OPT__SLASH_O) {
299305
StringRef OStr = A->getValue();
300306
if (OStr == "d") {

clang/test/Driver/dxc_hlsl-rootsig-ver.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clang_dxc -T cs_6_0 -fcgl %s | FileCheck %s --check-prefix=CHECK-V1_1
2-
// RUN: %clang_dxc -T cs_6_0 -fcgl -hlsl-rootsig-ver rootsig_1_0 %s | FileCheck %s --check-prefix=CHECK-V1_0
3-
// RUN: %clang_dxc -T cs_6_0 -fcgl -hlsl-rootsig-ver rootsig_1_1 %s | FileCheck %s --check-prefix=CHECK-V1_1
2+
// RUN: %clang_dxc -T cs_6_0 -fcgl -force-rootsig-ver rootsig_1_0 %s | FileCheck %s --check-prefix=CHECK-V1_0
3+
// RUN: %clang_dxc -T cs_6_0 -fcgl -force-rootsig-ver rootsig_1_1 %s | FileCheck %s --check-prefix=CHECK-V1_1
44

55
// Test to demonstrate that we can specify the root-signature versions
66

0 commit comments

Comments
 (0)