|
@@ -26,6 +26,9 @@ def CoreOption : OptionFlag;
|
|
// ISenseOption - This option is only supported for IntelliSense.
|
|
// ISenseOption - This option is only supported for IntelliSense.
|
|
def ISenseOption : OptionFlag;
|
|
def ISenseOption : OptionFlag;
|
|
|
|
|
|
|
|
+// RewriteOption - This is considered a "rewriter" HLSL option.
|
|
|
|
+def RewriteOption : OptionFlag;
|
|
|
|
+
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Groups
|
|
// Groups
|
|
|
|
|
|
@@ -66,6 +69,7 @@ def hlslcomp_Group : OptionGroup<"HLSL Compilation">, HelpText<"Compilation Opti
|
|
def hlsloptz_Group : OptionGroup<"HLSL Optimization">, HelpText<"Optimization Options">;
|
|
def hlsloptz_Group : OptionGroup<"HLSL Optimization">, HelpText<"Optimization Options">;
|
|
def hlslutil_Group : OptionGroup<"HLSL Utility">, HelpText<"Utility Options">;
|
|
def hlslutil_Group : OptionGroup<"HLSL Utility">, HelpText<"Utility Options">;
|
|
def hlslcore_Group : OptionGroup<"HLSL Core">, HelpText<"Common Options">;
|
|
def hlslcore_Group : OptionGroup<"HLSL Core">, HelpText<"Common Options">;
|
|
|
|
+def hlslrewrite_Group : OptionGroup<"HLSL Rewriter">, HelpText<"Rewriter Options">;
|
|
|
|
|
|
def spirv_Group : OptionGroup<"SPIR-V CodeGen">, HelpText<"SPIR-V CodeGen Options">; // SPIRV Change
|
|
def spirv_Group : OptionGroup<"SPIR-V CodeGen">, HelpText<"SPIR-V CodeGen Options">; // SPIRV Change
|
|
|
|
|
|
@@ -82,11 +86,11 @@ def spirv_Group : OptionGroup<"SPIR-V CodeGen">, HelpText<"SPIR-V CodeGen Option
|
|
// The general approach is to include only things that are in use, in the
|
|
// The general approach is to include only things that are in use, in the
|
|
// same order as in Options.td.
|
|
// same order as in Options.td.
|
|
|
|
|
|
-def D : JoinedOrSeparate<["-", "/"], "D">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
|
|
|
|
|
|
+def D : JoinedOrSeparate<["-", "/"], "D">, Group<hlslcomp_Group>, Flags<[CoreOption, RewriteOption]>,
|
|
HelpText<"Define macro">;
|
|
HelpText<"Define macro">;
|
|
def H : Flag<["-"], "H">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
|
|
def H : Flag<["-"], "H">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
|
|
HelpText<"Show header includes and nesting depth">;
|
|
HelpText<"Show header includes and nesting depth">;
|
|
-def I : JoinedOrSeparate<["-", "/"], "I">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
|
|
|
|
|
|
+def I : JoinedOrSeparate<["-", "/"], "I">, Group<hlslcomp_Group>, Flags<[CoreOption, RewriteOption]>,
|
|
HelpText<"Add directory to include search path">;
|
|
HelpText<"Add directory to include search path">;
|
|
def O0 : Flag<["-", "/"], "O0">, Group<hlsloptz_Group>, Flags<[CoreOption]>,
|
|
def O0 : Flag<["-", "/"], "O0">, Group<hlsloptz_Group>, Flags<[CoreOption]>,
|
|
HelpText<"Optimization Level 0">;
|
|
HelpText<"Optimization Level 0">;
|
|
@@ -212,13 +216,13 @@ def _help_question : Flag<["-", "/"], "?">, Flags<[DriverOption]>, Alias<help>;
|
|
|
|
|
|
def ast_dump : Flag<["-", "/"], "ast-dump">, Flags<[CoreOption, DriverOption, HelpHidden]>,
|
|
def ast_dump : Flag<["-", "/"], "ast-dump">, Flags<[CoreOption, DriverOption, HelpHidden]>,
|
|
HelpText<"Dumps the parsed Abstract Syntax Tree.">; // should not be core, but handy workaround until explicit API written
|
|
HelpText<"Dumps the parsed Abstract Syntax Tree.">; // should not be core, but handy workaround until explicit API written
|
|
-def external_lib : Separate<["-", "/"], "external">, Group<hlslcore_Group>, Flags<[DriverOption, HelpHidden]>,
|
|
|
|
|
|
+def external_lib : Separate<["-", "/"], "external">, Group<hlslcore_Group>, Flags<[DriverOption, RewriteOption, HelpHidden]>,
|
|
HelpText<"External DLL name to load for compiler support">;
|
|
HelpText<"External DLL name to load for compiler support">;
|
|
-def external_fn : Separate<["-", "/"], "external-fn">, Group<hlslcore_Group>, Flags<[DriverOption, HelpHidden]>,
|
|
|
|
|
|
+def external_fn : Separate<["-", "/"], "external-fn">, Group<hlslcore_Group>, Flags<[DriverOption, RewriteOption, HelpHidden]>,
|
|
HelpText<"External function name to load for compiler support">;
|
|
HelpText<"External function name to load for compiler support">;
|
|
def fcgl : Flag<["-", "/"], "fcgl">, Group<hlslcore_Group>, Flags<[CoreOption, HelpHidden]>,
|
|
def fcgl : Flag<["-", "/"], "fcgl">, Group<hlslcore_Group>, Flags<[CoreOption, HelpHidden]>,
|
|
HelpText<"Generate high-level code only">;
|
|
HelpText<"Generate high-level code only">;
|
|
-def flegacy_macro_expansion : Flag<["-", "/"], "flegacy-macro-expansion">, Group<hlslcomp_Group>, Flags<[CoreOption, DriverOption]>,
|
|
|
|
|
|
+def flegacy_macro_expansion : Flag<["-", "/"], "flegacy-macro-expansion">, Group<hlslcomp_Group>, Flags<[CoreOption, RewriteOption, DriverOption]>,
|
|
HelpText<"Expand the operands before performing token-pasting operation (fxc behavior)">;
|
|
HelpText<"Expand the operands before performing token-pasting operation (fxc behavior)">;
|
|
def flegacy_resource_reservation : Flag<["-", "/"], "flegacy-resource-reservation">, Group<hlslcomp_Group>, Flags<[CoreOption, DriverOption]>,
|
|
def flegacy_resource_reservation : Flag<["-", "/"], "flegacy-resource-reservation">, Group<hlslcomp_Group>, Flags<[CoreOption, DriverOption]>,
|
|
HelpText<"Reserve unused explicit register assignments for compatibility with shader model 5.0 and below">;
|
|
HelpText<"Reserve unused explicit register assignments for compatibility with shader model 5.0 and below">;
|
|
@@ -234,13 +238,13 @@ def pack_optimized : Flag<["-", "/"], "pack-optimized">, Group<hlslcomp_Group>,
|
|
HelpText<"Optimize signature packing assuming identical signature provided for each connecting stage">;
|
|
HelpText<"Optimize signature packing assuming identical signature provided for each connecting stage">;
|
|
def pack_optimized_ : Flag<["-", "/"], "pack_optimized">, Group<hlslcomp_Group>, Flags<[CoreOption, HelpHidden]>,
|
|
def pack_optimized_ : Flag<["-", "/"], "pack_optimized">, Group<hlslcomp_Group>, Flags<[CoreOption, HelpHidden]>,
|
|
HelpText<"Optimize signature packing assuming identical signature provided for each connecting stage">;
|
|
HelpText<"Optimize signature packing assuming identical signature provided for each connecting stage">;
|
|
-def hlsl_version : Separate<["-", "/"], "HV">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
|
|
|
|
|
|
+def hlsl_version : Separate<["-", "/"], "HV">, Group<hlslcomp_Group>, Flags<[CoreOption, RewriteOption]>,
|
|
HelpText<"HLSL version (2016, 2017, 2018). Default is 2018">;
|
|
HelpText<"HLSL version (2016, 2017, 2018). Default is 2018">;
|
|
-def no_warnings : Flag<["-", "/"], "no-warnings">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
|
|
|
|
|
|
+def no_warnings : Flag<["-", "/"], "no-warnings">, Group<hlslcomp_Group>, Flags<[CoreOption, RewriteOption]>,
|
|
HelpText<"Suppress warnings">;
|
|
HelpText<"Suppress warnings">;
|
|
def rootsig_define : Separate<["-", "/"], "rootsig-define">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
|
|
def rootsig_define : Separate<["-", "/"], "rootsig-define">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
|
|
HelpText<"Read root signature from a #define">;
|
|
HelpText<"Read root signature from a #define">;
|
|
-def enable_16bit_types: Flag<["-", "/"], "enable-16bit-types">, Flags<[CoreOption, DriverOption]>, Group<hlslcomp_Group>,
|
|
|
|
|
|
+def enable_16bit_types: Flag<["-", "/"], "enable-16bit-types">, Flags<[CoreOption, RewriteOption, DriverOption]>, Group<hlslcomp_Group>,
|
|
HelpText<"Enable 16bit types and disable min precision types. Available in HLSL 2018 and shader model 6.2">;
|
|
HelpText<"Enable 16bit types and disable min precision types. Available in HLSL 2018 and shader model 6.2">;
|
|
def ignore_line_directives : Flag<["-", "/"], "ignore-line-directives">, HelpText<"Ignore line directives">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
|
|
def ignore_line_directives : Flag<["-", "/"], "ignore-line-directives">, HelpText<"Ignore line directives">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
|
|
def auto_binding_space : Separate<["-", "/"], "auto-binding-space">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
|
|
def auto_binding_space : Separate<["-", "/"], "auto-binding-space">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
|
|
@@ -251,7 +255,7 @@ def export_shaders_only : Flag<["-", "/"], "export-shaders-only">, Group<hlslcom
|
|
HelpText<"Only export shaders when compiling a library">;
|
|
HelpText<"Only export shaders when compiling a library">;
|
|
def default_linkage : Separate<["-", "/"], "default-linkage">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
|
|
def default_linkage : Separate<["-", "/"], "default-linkage">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
|
|
HelpText<"Set default linkage for non-shader functions when compiling or linking to a library target (internal, external)">;
|
|
HelpText<"Set default linkage for non-shader functions when compiling or linking to a library target (internal, external)">;
|
|
-def encoding : Separate<["-", "/"], "encoding">, Group<hlslcomp_Group>, Flags<[CoreOption, DriverOption]>,
|
|
|
|
|
|
+def encoding : Separate<["-", "/"], "encoding">, Group<hlslcomp_Group>, Flags<[CoreOption, RewriteOption, DriverOption]>,
|
|
HelpText<"Set default encoding for text outputs (utf8|utf16) default=utf8">;
|
|
HelpText<"Set default encoding for text outputs (utf8|utf16) default=utf8">;
|
|
def validator_version : Separate<["-", "/"], "validator-version">, Group<hlslcomp_Group>, Flags<[CoreOption, HelpHidden]>,
|
|
def validator_version : Separate<["-", "/"], "validator-version">, Group<hlslcomp_Group>, Flags<[CoreOption, HelpHidden]>,
|
|
HelpText<"Override validator version for module. Format: <major.minor> ; Default: DXIL.dll version or current internal version.">;
|
|
HelpText<"Override validator version for module. Format: <major.minor> ; Default: DXIL.dll version or current internal version.">;
|
|
@@ -314,7 +318,7 @@ def target_profile : JoinedOrSeparate<["-", "/"], "T">, Flags<[CoreOption]>, Gro
|
|
// VALRULE-TEXT:BEGIN
|
|
// VALRULE-TEXT:BEGIN
|
|
HelpText<"Set target profile. \n\t<profile>: ps_6_0, ps_6_1, ps_6_2, ps_6_3, ps_6_4, ps_6_5, \n\t\t vs_6_0, vs_6_1, vs_6_2, vs_6_3, vs_6_4, vs_6_5, \n\t\t gs_6_0, gs_6_1, gs_6_2, gs_6_3, gs_6_4, gs_6_5, \n\t\t hs_6_0, hs_6_1, hs_6_2, hs_6_3, hs_6_4, hs_6_5, \n\t\t ds_6_0, ds_6_1, ds_6_2, ds_6_3, ds_6_4, ds_6_5, \n\t\t cs_6_0, cs_6_1, cs_6_2, cs_6_3, cs_6_4, cs_6_5, \n\t\t lib_6_1, lib_6_2, lib_6_3, lib_6_4, lib_6_5, \n\t\t ms_6_5, \n\t\t as_6_5, \n\t\t ">;
|
|
HelpText<"Set target profile. \n\t<profile>: ps_6_0, ps_6_1, ps_6_2, ps_6_3, ps_6_4, ps_6_5, \n\t\t vs_6_0, vs_6_1, vs_6_2, vs_6_3, vs_6_4, vs_6_5, \n\t\t gs_6_0, gs_6_1, gs_6_2, gs_6_3, gs_6_4, gs_6_5, \n\t\t hs_6_0, hs_6_1, hs_6_2, hs_6_3, hs_6_4, hs_6_5, \n\t\t ds_6_0, ds_6_1, ds_6_2, ds_6_3, ds_6_4, ds_6_5, \n\t\t cs_6_0, cs_6_1, cs_6_2, cs_6_3, cs_6_4, cs_6_5, \n\t\t lib_6_1, lib_6_2, lib_6_3, lib_6_4, lib_6_5, \n\t\t ms_6_5, \n\t\t as_6_5, \n\t\t ">;
|
|
// VALRULE-TEXT:END
|
|
// VALRULE-TEXT:END
|
|
-def entrypoint : JoinedOrSeparate<["-", "/"], "E">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
|
|
|
|
|
|
+def entrypoint : JoinedOrSeparate<["-", "/"], "E">, Flags<[CoreOption, RewriteOption]>, Group<hlslcomp_Group>,
|
|
HelpText<"Entry point name">;
|
|
HelpText<"Entry point name">;
|
|
// /I <include> - already defined above
|
|
// /I <include> - already defined above
|
|
def _vi : Flag<["-", "/"], "Vi">, Alias<H>, Flags<[CoreOption]>, Group<hlslcomp_Group>,
|
|
def _vi : Flag<["-", "/"], "Vi">, Alias<H>, Flags<[CoreOption]>, Group<hlslcomp_Group>,
|
|
@@ -348,7 +352,7 @@ def Gis : Flag<["-", "/"], "Gis">, HelpText<"Force IEEE strictness">, Flags<[Cor
|
|
|
|
|
|
def denorm : JoinedOrSeparate<["-", "/"], "denorm">, HelpText<"select denormal value options (any, preserve, ftz). any is the default.">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
|
|
def denorm : JoinedOrSeparate<["-", "/"], "denorm">, HelpText<"select denormal value options (any, preserve, ftz). any is the default.">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
|
|
|
|
|
|
-def Fo : JoinedOrSeparate<["-", "/"], "Fo">, MetaVarName<"<file>">, HelpText<"Output object file">, Flags<[CoreOption, DriverOption]>, Group<hlslcomp_Group>;
|
|
|
|
|
|
+def Fo : JoinedOrSeparate<["-", "/"], "Fo">, MetaVarName<"<file>">, HelpText<"Output object file">, Flags<[CoreOption, RewriteOption, DriverOption]>, Group<hlslcomp_Group>;
|
|
// def Fl : JoinedOrSeparate<["-", "/"], "Fl">, MetaVarName<"<file>">, HelpText<"Output a library">;
|
|
// def Fl : JoinedOrSeparate<["-", "/"], "Fl">, MetaVarName<"<file>">, HelpText<"Output a library">;
|
|
def Fc : JoinedOrSeparate<["-", "/"], "Fc">, MetaVarName<"<file>">, HelpText<"Output assembly code listing file">, Flags<[DriverOption]>, Group<hlslcomp_Group>;
|
|
def Fc : JoinedOrSeparate<["-", "/"], "Fc">, MetaVarName<"<file>">, HelpText<"Output assembly code listing file">, Flags<[DriverOption]>, Group<hlslcomp_Group>;
|
|
//def Fx : JoinedOrSeparate<["-", "/"], "Fx">, MetaVarName<"<file>">, HelpText<"Output assembly code and hex listing file">;
|
|
//def Fx : JoinedOrSeparate<["-", "/"], "Fx">, MetaVarName<"<file>">, HelpText<"Output assembly code and hex listing file">;
|
|
@@ -426,5 +430,23 @@ def getprivate : JoinedOrSeparate<["-", "/"], "getprivate">, Flags<[DriverOption
|
|
def nologo : Flag<["-", "/"], "nologo">, Group<hlslcore_Group>, Flags<[DriverOption]>,
|
|
def nologo : Flag<["-", "/"], "nologo">, Group<hlslcore_Group>, Flags<[DriverOption]>,
|
|
HelpText<"Suppress copyright message">;
|
|
HelpText<"Suppress copyright message">;
|
|
|
|
|
|
|
|
+//////////////////////////////////////////////////////////////////////////////
|
|
|
|
+// Rewriter Options
|
|
|
|
+
|
|
|
|
+def rw_unchanged : Flag<["-", "/"], "unchanged">, Group<hlslrewrite_Group>, Flags<[RewriteOption]>,
|
|
|
|
+ HelpText<"Rewrite HLSL, without changes.">;
|
|
|
|
+def rw_skip_function_body : Flag<["-", "/"], "skip-fn-body">, Group<hlslrewrite_Group>, Flags<[RewriteOption]>,
|
|
|
|
+ HelpText<"Translate function definitions to declarations">;
|
|
|
|
+def rw_skip_static : Flag<["-", "/"], "skip-static">, Group<hlslrewrite_Group>, Flags<[RewriteOption]>,
|
|
|
|
+ HelpText<"Remove static functions and globals when used with -skip-fn-body">;
|
|
|
|
+def rw_global_extern_by_default : Flag<["-", "/"], "global-extern-by-default">, Group<hlslrewrite_Group>, Flags<[RewriteOption]>,
|
|
|
|
+ HelpText<"Set extern on non-static globals">;
|
|
|
|
+def rw_keep_user_macro : Flag<["-", "/"], "keep-user-macro">, Group<hlslrewrite_Group>, Flags<[RewriteOption]>,
|
|
|
|
+ HelpText<"Write out user defines after rewritten HLSL">;
|
|
|
|
+def rw_extract_entry_uniforms : Flag<["-", "/"], "extract-entry-uniforms">, Group<hlslrewrite_Group>, Flags<[RewriteOption]>,
|
|
|
|
+ HelpText<"Move uniform parameters from entry point to global scope">;
|
|
|
|
+def rw_remove_unused_globals : Flag<["-", "/"], "remove-unused-globals">, Group<hlslrewrite_Group>, Flags<[RewriteOption]>,
|
|
|
|
+ HelpText<"Remove unused static globals and functions">;
|
|
|
|
+
|
|
// Also removed: compress, decompress, /Gch (child effect), /Gpp (partial precision)
|
|
// Also removed: compress, decompress, /Gch (child effect), /Gpp (partial precision)
|
|
// /Op - no support for preshaders.
|
|
// /Op - no support for preshaders.
|