Skip to content

Commit 373add4

Browse files
committed
define the fdx-rootsignature-define option
1 parent d91de5f commit 373add4

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

clang/include/clang/Basic/LangOptions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,10 @@ class LangOptions : public LangOptionsBase {
552552
llvm::dxbc::RootSignatureVersion HLSLRootSigVer =
553553
llvm::dxbc::RootSignatureVersion::V1_1;
554554

555+
/// The HLSL root signature that will be used to overide the root signature
556+
/// used for the shader entry point.
557+
std::string HLSLRootSigOverride;
558+
555559
// Indicates if the wasm-opt binary must be ignored in the case of a
556560
// WebAssembly target.
557561
bool NoWasmOpt = false;

clang/include/clang/Driver/Options.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9436,6 +9436,13 @@ def dxc_rootsig_ver :
94369436
Alias<fdx_rootsignature_version>,
94379437
Group<dxc_Group>,
94389438
Visibility<[DXCOption]>;
9439+
def fdx_rootsignature_define :
9440+
Joined<["-"], "fdx-rootsignature-define=">,
9441+
Group<dxc_Group>,
9442+
Visibility<[ClangOption, CC1Option]>,
9443+
MarshallingInfoString<LangOpts<"HLSLRootSigOverride">, "\"\"">,
9444+
HelpText<"Override entry function root signature with root signature at "
9445+
"given macro name.">;
94399446
def hlsl_entrypoint : Option<["-"], "hlsl-entry", KIND_SEPARATE>,
94409447
Group<dxc_Group>,
94419448
Visibility<[ClangOption, CC1Option]>,

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,10 @@ static bool FixupInvocation(CompilerInvocation &Invocation,
640640
Diags.Report(diag::err_drv_argument_not_allowed_with)
641641
<< "-fdx-rootsignature-version" << GetInputKindName(IK);
642642

643+
if (Args.hasArg(OPT_fdx_rootsignature_define) && !LangOpts.HLSL)
644+
Diags.Report(diag::err_drv_argument_not_allowed_with)
645+
<< "-fdx-rootsignature-define" << GetInputKindName(IK);
646+
643647
if (Args.hasArg(OPT_fgpu_allow_device_init) && !LangOpts.HIP)
644648
Diags.Report(diag::warn_ignored_hip_only_option)
645649
<< Args.getLastArg(OPT_fgpu_allow_device_init)->getAsString(Args);

0 commit comments

Comments
 (0)