HLSLOptions.td 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. //===--- HLSLOptions.td - Options for HLSL --------------------------------===//
  2. ///////////////////////////////////////////////////////////////////////////////
  3. // //
  4. // HLSLOptions.td //
  5. // Copyright (C) Microsoft Corporation. All rights reserved. //
  6. // This file is distributed under the University of Illinois Open Source //
  7. // License. See LICENSE.TXT for details. //
  8. // //
  9. // This file defines the options accepted by HLSL. //
  10. // //
  11. ///////////////////////////////////////////////////////////////////////////////
  12. // Include the common option parsing interfaces. //
  13. include "llvm/Option/OptParser.td"
  14. //////////////////////////////////////////////////////////////////////////////
  15. // Flags
  16. // DriverOption - The option is a "driver" option, and should not be forwarded
  17. // to other tools.
  18. def DriverOption : OptionFlag;
  19. // CoreOption - This is considered a "core" HLSL option.
  20. def CoreOption : OptionFlag;
  21. // ISenseOption - This option is only supported for IntelliSense.
  22. def ISenseOption : OptionFlag;
  23. //////////////////////////////////////////////////////////////////////////////
  24. // Groups
  25. // Meta-group for options which are only used for compilation,
  26. // and not linking etc.
  27. def CompileOnly_Group : OptionGroup<"<CompileOnly group>">;
  28. def Action_Group : OptionGroup<"<action group>">;
  29. def I_Group : OptionGroup<"<I group>">, Group<CompileOnly_Group>;
  30. def M_Group : OptionGroup<"<M group>">, Group<CompileOnly_Group>;
  31. def T_Group : OptionGroup<"<T group>">;
  32. def O_Group : OptionGroup<"<O group>">, Group<CompileOnly_Group>;
  33. def R_Group : OptionGroup<"<R group>">, Group<CompileOnly_Group>;
  34. def R_value_Group : OptionGroup<"<R (with value) group>">, Group<R_Group>;
  35. def W_Group : OptionGroup<"<W group>">, Group<CompileOnly_Group>;
  36. def W_value_Group : OptionGroup<"<W (with value) group>">, Group<W_Group>;
  37. def d_Group : OptionGroup<"<d group>">;
  38. def f_Group : OptionGroup<"<f group>">, Group<CompileOnly_Group>;
  39. def f_clang_Group : OptionGroup<"<f (clang-only) group>">, Group<CompileOnly_Group>;
  40. def g_Group : OptionGroup<"<g group>">;
  41. def g_flags_Group : OptionGroup<"<g flags group>">;
  42. def i_Group : OptionGroup<"<i group>">, Group<CompileOnly_Group>;
  43. def clang_i_Group : OptionGroup<"<clang i group>">, Group<i_Group>;
  44. def m_Group : OptionGroup<"<m group>">, Group<CompileOnly_Group>;
  45. def u_Group : OptionGroup<"<u group>">;
  46. // Developer Driver Options
  47. def internal_Group : OptionGroup<"<clang internal options>">;
  48. def internal_driver_Group : OptionGroup<"<clang driver internal options>">,
  49. Group<internal_Group>, HelpText<"DRIVER OPTIONS">;
  50. def internal_debug_Group :
  51. OptionGroup<"<clang debug/development internal options>">,
  52. Group<internal_Group>, HelpText<"DEBUG/DEVELOPMENT OPTIONS">;
  53. def hlslcomp_Group : OptionGroup<"HLSL Compilation">, HelpText<"Compilation Options">;
  54. def hlsloptz_Group : OptionGroup<"HLSL Optimization">, HelpText<"Optimization Options">;
  55. def hlslutil_Group : OptionGroup<"HLSL Utility">, HelpText<"Utility Options">;
  56. def hlslcore_Group : OptionGroup<"HLSL Core">, HelpText<"Common Options">;
  57. def spirv_Group : OptionGroup<"SPIR-V CodeGen">, HelpText<"SPIR-V CodeGen Options">; // SPIRV Change
  58. //////////////////////////////////////////////////////////////////////////////
  59. // Options
  60. // The internal option ID must be a valid C++ identifier and results in a
  61. // hlsl::options::OPT_XX enum constant for XX.
  62. //
  63. // See tools/clang/include/clang/Driver/Options.td for more notes.
  64. // These options are based on those used by clang.
  65. // fxc-based options kept for compatiblity are below.
  66. //
  67. // The general approach is to include only things that are in use, in the
  68. // same order as in Options.td.
  69. def D : JoinedOrSeparate<["-", "/"], "D">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  70. HelpText<"Define macro">;
  71. def H : Flag<["-"], "H">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  72. HelpText<"Show header includes and nesting depth">;
  73. def I : JoinedOrSeparate<["-", "/"], "I">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  74. HelpText<"Add directory to include search path">;
  75. def O0 : Flag<["-", "/"], "O0">, Group<hlsloptz_Group>, Flags<[CoreOption]>,
  76. HelpText<"Optimization Level 0">;
  77. def O1 : Flag<["-", "/"], "O1">, Group<hlsloptz_Group>, Flags<[CoreOption]>,
  78. HelpText<"Optimization Level 1">;
  79. def O2 : Flag<["-", "/"], "O2">, Group<hlsloptz_Group>, Flags<[CoreOption]>,
  80. HelpText<"Optimization Level 2">;
  81. def O3 : Flag<["-", "/"], "O3">, Group<hlsloptz_Group>, Flags<[CoreOption]>,
  82. HelpText<"Optimization Level 3 (Default)">;
  83. def O4 : Flag<["-", "/"], "O4">, Group<hlsloptz_Group>, Flags<[CoreOption]>,
  84. HelpText<"Optimization Level 4">;
  85. def Odump : Flag<["-", "/"], "Odump">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  86. HelpText<"Print the optimizer commands.">;
  87. def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Group<hlslcore_Group>, Flags<[CoreOption]>,
  88. HelpText<"Don't emit warning for unused driver arguments">;
  89. def Wall : Flag<["-"], "Wall">, Group<hlslcomp_Group>, Flags<[CoreOption]>;
  90. def Wdeprecated : Flag<["-"], "Wdeprecated">, Group<hlslcomp_Group>, Flags<[CoreOption]>;
  91. //def W_Joined : Joined<["-"], "W">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  92. // MetaVarName<"<warning>">, HelpText<"Enable the specified warning">;
  93. def d_Flag : Flag<["-"], "d">, Group<d_Group>;
  94. def d_Joined : Joined<["-"], "d">, Group<d_Group>;
  95. //def fcolor_diagnostics : Flag<["-"], "fcolor-diagnostics">, Group<hlslcomp_Group>,
  96. // Flags<[CoreOption, DriverOption]>, HelpText<"Use colors in diagnostics">;
  97. def fdiagnostics_color : Flag<["-"], "fdiagnostics-color">, Group<hlslcomp_Group>,
  98. Flags<[CoreOption, DriverOption]>;
  99. def fdiagnostics_color_EQ : Joined<["-"], "fdiagnostics-color=">, Group<hlslcomp_Group>;
  100. //def fansi_escape_codes : Flag<["-"], "fansi-escape-codes">, Group<f_Group>, // HLSL Change: disable ANSI escape codes
  101. // Flags<[CoreOption, CC1Option]>, HelpText<"Use ANSI escape codes for diagnostics">;
  102. def fconstexpr_depth_EQ : Joined<["-"], "fconstexpr-depth=">, Group<f_Group>;
  103. def fconstexpr_steps_EQ : Joined<["-"], "fconstexpr-steps=">, Group<f_Group>;
  104. def fconstexpr_backtrace_limit_EQ : Joined<["-"], "fconstexpr-backtrace-limit=">,
  105. Group<f_Group>;
  106. //def fdiagnostics_show_option : Flag<["-"], "fdiagnostics-show-option">, Group<hlslcomp_Group>,
  107. // Flags<[CoreOption]>, HelpText<"Print option name with mappable diagnostics">;
  108. def fdiagnostics_show_category_EQ : Joined<["-"], "fdiagnostics-show-category=">, Group<hlslcomp_Group>;
  109. def ferror_limit_EQ : Joined<["-"], "ferror-limit=">, Group<hlslcomp_Group>, Flags<[CoreOption]>;
  110. def funsafe_math_optimizations : Flag<["-"], "funsafe-math-optimizations">,
  111. Group<hlsloptz_Group>;
  112. def fno_unsafe_math_optimizations : Flag<["-"], "fno-unsafe-math-optimizations">,
  113. Group<hlsloptz_Group>;
  114. def fassociative_math : Flag<["-"], "fassociative-math">, Group<hlsloptz_Group>;
  115. def fno_associative_math : Flag<["-"], "fno-associative-math">, Group<hlsloptz_Group>;
  116. //def freciprocal_math :
  117. // Flag<["-"], "freciprocal-math">, Group<hlsloptz_Group>, Flags<[CoreOption]>,
  118. // HelpText<"Allow division operations to be reassociated">;
  119. def fno_reciprocal_math : Flag<["-"], "fno-reciprocal-math">, Group<hlsloptz_Group>;
  120. def ffinite_math_only : Flag<["-"], "ffinite-math-only">, Group<hlsloptz_Group>, Flags<[CoreOption]>;
  121. def fno_finite_math_only : Flag<["-"], "fno-finite-math-only">, Group<hlsloptz_Group>;
  122. def fsigned_zeros : Flag<["-"], "fsigned-zeros">, Group<hlsloptz_Group>;
  123. //def fno_signed_zeros :
  124. // Flag<["-"], "fno-signed-zeros">, Group<hlsloptz_Group>, Flags<[CoreOption]>,
  125. // HelpText<"Allow optimizations that ignore the sign of floating point zeros">;
  126. def fhonor_nans : Flag<["-"], "fhonor-nans">, Group<hlsloptz_Group>;
  127. def fno_honor_nans : Flag<["-"], "fno-honor-nans">, Group<hlsloptz_Group>;
  128. def fhonor_infinities : Flag<["-"], "fhonor-infinities">, Group<hlsloptz_Group>;
  129. def fno_honor_infinities : Flag<["-"], "fno-honor-infinities">, Group<hlsloptz_Group>;
  130. //def ftrapping_math : Flag<["-"], "ftrapping-math">, Group<f_Group>;
  131. //def fno_trapping_math : Flag<["-"], "fno-trapping-math">, Group<f_Group>;
  132. //def ffp_contract : Joined<["-"], "ffp-contract=">, Group<hlsloptz_Group>,
  133. // Flags<[CoreOption]>, HelpText<"Form fused FP ops (e.g. FMAs): fast (everywhere)"
  134. // " | on (according to FP_CONTRACT pragma, default) | off (never fuse)">;
  135. def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group<hlsloptz_Group>;
  136. /*
  137. def fno_caret_diagnostics : Flag<["-"], "fno-caret-diagnostics">, Group<hlslcomp_Group>,
  138. Flags<[CoreOption]>;
  139. def fno_color_diagnostics : Flag<["-"], "fno-color-diagnostics">, Group<hlslcomp_Group>,
  140. Flags<[CoreOption]>;
  141. def fno_diagnostics_color : Flag<["-"], "fno-diagnostics-color">, Group<hlslcomp_Group>,
  142. Flags<[CoreOption, DriverOption]>;
  143. def fno_show_column : Flag<["-"], "fno-show-column">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  144. HelpText<"Do not include column number on diagnostics">;
  145. def fno_spell_checking : Flag<["-"], "fno-spell-checking">, Group<hlslcomp_Group>,
  146. Flags<[CoreOption]>, HelpText<"Disable spell-checking">;
  147. def fshow_column : Flag<["-"], "fshow-column">, Group<hlslcomp_Group>, Flags<[CoreOption]>;
  148. def fshow_source_location : Flag<["-"], "fshow-source-location">, Group<hlslcomp_Group>;
  149. def fspell_checking : Flag<["-"], "fspell-checking">, Group<hlslcomp_Group>;
  150. def fspell_checking_limit_EQ : Joined<["-"], "fspell-checking-limit=">, Group<hlslcomp_Group>;
  151. def funroll_loops : Flag<["-"], "funroll-loops">, Group<hlsloptz_Group>,
  152. HelpText<"Turn on loop unroller">, Flags<[CoreOption]>;
  153. def fno_unroll_loops : Flag<["-"], "fno-unroll-loops">, Group<hlsloptz_Group>,
  154. HelpText<"Turn off loop unroller">, Flags<[CoreOption]>;
  155. def freroll_loops : Flag<["-"], "freroll-loops">, Group<hlsloptz_Group>,
  156. HelpText<"Turn on loop reroller">, Flags<[CoreOption]>;
  157. def fno_reroll_loops : Flag<["-"], "fno-reroll-loops">, Group<hlsloptz_Group>,
  158. HelpText<"Turn off loop reroller">;
  159. */
  160. def help : Flag<["-", "--", "/"], "help">, Flags<[DriverOption]>, Group<hlslcore_Group>,
  161. HelpText<"Display available options">;
  162. /*
  163. def imacros : JoinedOrSeparate<["-", "--"], "imacros">, Group<clang_i_Group>, Flags<[CoreOption]>,
  164. HelpText<"Include macros from file before parsing">, MetaVarName<"<file>">;
  165. def include_ : JoinedOrSeparate<["-", "--"], "include">, Group<clang_i_Group>, EnumName<"include">,
  166. MetaVarName<"<file>">, HelpText<"Include file before parsing">, Flags<[CoreOption]>;
  167. def mllvm : Separate<["-"], "mllvm">, Flags<[CoreOption]>,
  168. HelpText<"Additional arguments to forward to LLVM's option processing">;
  169. def mms_bitfields : Flag<["-"], "mms-bitfields">, Group<m_Group>, Flags<[CoreOption]>,
  170. HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard">;
  171. def o : JoinedOrSeparate<["-"], "o">, Flags<[DriverOption, RenderAsInput, CoreOption]>,
  172. HelpText<"Write output to <file>">, MetaVarName<"<file>">;
  173. def time : Flag<["-"], "time">,
  174. HelpText<"Time individual commands">;
  175. // def U : JoinedOrSeparate<["-"], "U">, Group<CompileOnly_Group>, Flags<[CoreOption]>;
  176. def w : Flag<["-"], "w">, HelpText<"Suppress all warnings">, Flags<[CoreOption]>;
  177. def working_directory : JoinedOrSeparate<["-"], "working-directory">, Flags<[CoreOption]>,
  178. MetaVarName<"<dir>">, HelpText<"Resolve file paths relative to the specified directory">;
  179. def working_directory_EQ : Joined<["-"], "working-directory=">, Flags<[CoreOption]>,
  180. MetaVarName<"<dir>">, Alias<working_directory>;
  181. */
  182. // Double dash options, which are usually an alias for one of the previous
  183. // options.
  184. def _all_warnings : Flag<["--"], "all-warnings">, Flags<[CoreOption]>, Alias<Wall>;
  185. def _help_hidden : Flag<["--"], "help-hidden">, Flags<[DriverOption]>;
  186. def _help_question : Flag<["-", "/"], "?">, Flags<[DriverOption]>, Alias<help>;
  187. //////////////////////////////////////////////////////////////////////////////
  188. // New HLSL-specific flags.
  189. def ast_dump : Flag<["-", "/"], "ast-dump">, Flags<[CoreOption, DriverOption, HelpHidden]>,
  190. HelpText<"Dumps the parsed Abstract Syntax Tree.">; // should not be core, but handy workaround until explicit API written
  191. def external_lib : Separate<["-", "/"], "external">, Group<hlslcore_Group>, Flags<[DriverOption, HelpHidden]>,
  192. HelpText<"External DLL name to load for compiler support">;
  193. def external_fn : Separate<["-", "/"], "external-fn">, Group<hlslcore_Group>, Flags<[DriverOption, HelpHidden]>,
  194. HelpText<"External function name to load for compiler support">;
  195. def fcgl : Flag<["-", "/"], "fcgl">, Group<hlslcore_Group>, Flags<[CoreOption, HelpHidden]>,
  196. HelpText<"Generate high-level code only">;
  197. def not_use_legacy_cbuf_load : Flag<["-", "/"], "not_use_legacy_cbuf_load">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  198. HelpText<"Do not use legacy cbuffer load">;
  199. def pack_prefix_stable : Flag<["-", "/"], "pack_prefix_stable">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  200. HelpText<"(default) Pack signatures preserving prefix-stable property - appended elements will not disturb placement of prior elements">;
  201. def pack_optimized : Flag<["-", "/"], "pack_optimized">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  202. HelpText<"Optimize signature packing assuming identical signature provided for each connecting stage">;
  203. def hlsl_version : Separate<["-", "/"], "HV">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  204. HelpText<"HLSL version (2016, 2017, 2018). Default is 2018">;
  205. def no_warnings : Flag<["-", "/"], "no-warnings">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  206. HelpText<"Suppress warnings">;
  207. def rootsig_define : Separate<["-", "/"], "rootsig-define">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  208. HelpText<"Read root signature from a #define">;
  209. def enable_16bit_types: Flag<["-", "/"], "enable-16bit-types">, Flags<[CoreOption, DriverOption]>, Group<hlslcomp_Group>,
  210. HelpText<"Enable 16bit types and disable min precision types. Available in HLSL 2018 and shader model 6.2">;
  211. def ignore_line_directives : Flag<["-", "/"], "ignore-line-directives">, HelpText<"Ignore line directives">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
  212. def auto_binding_space : Separate<["-", "/"], "auto-binding-space">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  213. HelpText<"Set auto binding space - enables auto resource binding in libraries">;
  214. def exports : Separate<["-", "/"], "exports">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  215. HelpText<"Specify exports when compiling a library: export1[[,export1_clone,...]=internal_name][;...]">;
  216. def export_shaders_only : Flag<["-", "/"], "export-shaders-only">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  217. HelpText<"Only export shaders when compiling a library">;
  218. def default_linkage : Separate<["-", "/"], "default-linkage">, Group<hlslcomp_Group>, Flags<[CoreOption]>,
  219. HelpText<"Set default linkage for non-shader functions when compiling or linking to a library target (internal, external)">;
  220. // SPIRV Change Starts
  221. def spirv : Flag<["-"], "spirv">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  222. HelpText<"Generate SPIR-V code">;
  223. def fvk_stage_io_order_EQ : Joined<["-"], "fvk-stage-io-order=">, Group<spirv_Group>, Flags<[CoreOption, DriverOption, HelpHidden]>,
  224. HelpText<"Specify Vulkan stage I/O location assignment order">;
  225. def fvk_b_shift : MultiArg<["-"], "fvk-b-shift", 2>, MetaVarName<"<shift> <space>">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  226. HelpText<"Specify Vulkan binding number shift for b-type register">;
  227. def fvk_t_shift : MultiArg<["-"], "fvk-t-shift", 2>, MetaVarName<"<shift> <space>">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  228. HelpText<"Specify Vulkan binding number shift for t-type register">;
  229. def fvk_s_shift : MultiArg<["-"], "fvk-s-shift", 2>, MetaVarName<"<shift> <space>">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  230. HelpText<"Specify Vulkan binding number shift for s-type register">;
  231. def fvk_u_shift : MultiArg<["-"], "fvk-u-shift", 2>, MetaVarName<"<shift> <space>">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  232. HelpText<"Specify Vulkan binding number shift for u-type register">;
  233. def fvk_bind_register : MultiArg<["-"], "fvk-bind-register", 4>, MetaVarName<"<type-number> <space> <binding> <set>">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  234. HelpText<"Specify Vulkan descriptor set and binding for a specific register">;
  235. def vkbr : MultiArg<["-"], "vkbr", 4>, Flags<[CoreOption, DriverOption]>, Alias<fvk_bind_register>;
  236. def fvk_invert_y: Flag<["-"], "fvk-invert-y">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  237. HelpText<"Negate SV_Position.y before writing to stage output in VS/DS/GS to accommodate Vulkan's coordinate system">;
  238. def fvk_use_dx_position_w: Flag<["-"], "fvk-use-dx-position-w">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  239. HelpText<"Reciprocate SV_Position.w after reading from stage input in PS to accommodate the difference between Vulkan and DirectX">;
  240. def fvk_use_gl_layout: Flag<["-"], "fvk-use-gl-layout">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  241. HelpText<"Use strict OpenGL std140/std430 memory layout for Vulkan resources">;
  242. def fvk_use_dx_layout: Flag<["-"], "fvk-use-dx-layout">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  243. HelpText<"Use DirectX memory layout for Vulkan resources">;
  244. def fspv_reflect: Flag<["-"], "fspv-reflect">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  245. HelpText<"Emit additional SPIR-V instructions to aid reflection">;
  246. def fspv_debug_EQ : Joined<["-"], "fspv-debug=">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  247. HelpText<"Specify whitelist of debug info category (file -> source -> line, tool)">;
  248. def fspv_extension_EQ : Joined<["-"], "fspv-extension=">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  249. HelpText<"Specify SPIR-V extension permitted to use">;
  250. def fspv_target_env_EQ : Joined<["-"], "fspv-target-env=">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
  251. HelpText<"Specify the target environment: vulkan1.0 (default) or vulkan1.1">;
  252. def Wno_vk_ignored_features : Joined<["-"], "Wno-vk-ignored-features">, Group<spirv_Group>, Flags<[CoreOption, DriverOption, HelpHidden]>,
  253. HelpText<"Do not emit warnings for ingored features resulting from no Vulkan support">;
  254. def Wno_vk_emulated_features : Joined<["-"], "Wno-vk-emulated-features">, Group<spirv_Group>, Flags<[CoreOption, DriverOption, HelpHidden]>,
  255. HelpText<"Do not emit warnings for emulated features resulting from no direct mapping">;
  256. def Oconfig : CommaJoined<["-"], "Oconfig=">, Group<spirv_Group>, Flags<[CoreOption]>,
  257. HelpText<"Specify a comma-separated list of SPIRV-Tools passes to customize optimization configuration (see http://khr.io/hlsl2spirv#optimization)">;
  258. // SPIRV Change Ends
  259. //////////////////////////////////////////////////////////////////////////////
  260. // fxc-based flags that don't match those previously defined.
  261. def target_profile : JoinedOrSeparate<["-", "/"], "T">, Flags<[CoreOption]>, Group<hlslcomp_Group>, MetaVarName<"<profile>">,
  262. HelpText<"Set target profile. \n\t<profile>: ps_6_0, ps_6_1, ps_6_2, ps_6_3, \n\t\t vs_6_0, vs_6_1, vs_6_2, vs_6_3, \n\t\t cs_6_0, cs_6_1, cs_6_2, cs_6_3, \n\t\t gs_6_0, gs_6_1, gs_6_2, gs_6_3, \n\t\t ds_6_0, ds_6_1, ds_6_2, ds_6_3, \n\t\t hs_6_0, hs_6_1, hs_6_2, hs_6_3, \n\t\t lib_6_3">;
  263. def entrypoint : JoinedOrSeparate<["-", "/"], "E">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  264. HelpText<"Entry point name">;
  265. // /I <include> - already defined above
  266. def _vi : Flag<["-", "/"], "Vi">, Alias<H>, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  267. HelpText<"Display details about the include process.">;
  268. def Od : Flag<["-", "/"], "Od">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  269. HelpText<"Disable optimizations">;
  270. def _SLASH_WX : Flag<["-", "/"], "WX">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  271. HelpText<"Treat warnings as errors">;
  272. def VD : Flag<["-", "/"], "Vd">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  273. HelpText<"Disable validation">;
  274. def _SLASH_Zi : Flag<["-", "/"], "Zi">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  275. HelpText<"Enable debug information">;
  276. def recompile : Flag<["-", "/"], "recompile">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  277. HelpText<"recompile from DXIL container with Debug Info or Debug Info bitcode file">;
  278. def Zpr : Flag<["-", "/"], "Zpr">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  279. HelpText<"Pack matrices in row-major order">;
  280. def Zpc : Flag<["-", "/"], "Zpc">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  281. HelpText<"Pack matrices in column-major order">;
  282. def Zss : Flag<["-", "/"], "Zss">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  283. HelpText<"Build debug name considering source information">;
  284. def Zsb : Flag<["-", "/"], "Zsb">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  285. HelpText<"Build debug name considering only output binary">;
  286. // deprecated /Gpp def Gpp : Flag<["-", "/"], "Gpp">, HelpText<"Force partial precision">;
  287. def Gfa : Flag<["-", "/"], "Gfa">, HelpText<"Avoid flow control constructs">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
  288. def Gfp : Flag<["-", "/"], "Gfp">, HelpText<"Prefer flow control constructs">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
  289. // /Gdp - disable effect performance mode - unsupported
  290. def Gec : Flag<["-", "/"], "Gec">, HelpText<"Enable backward compatibility mode">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
  291. def Ges : Flag<["-", "/"], "Ges">, HelpText<"Enable strict mode">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
  292. def Gis : Flag<["-", "/"], "Gis">, HelpText<"Force IEEE strictness">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
  293. def denorm : JoinedOrSeparate<["-", "/"], "denorm">, HelpText<"select denormal value options (any, preserve, ftz). any is the default.">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
  294. def Fo : JoinedOrSeparate<["-", "/"], "Fo">, MetaVarName<"<file>">, HelpText<"Output object file">, Flags<[DriverOption]>, Group<hlslcomp_Group>;
  295. // def Fl : JoinedOrSeparate<["-", "/"], "Fl">, MetaVarName<"<file>">, HelpText<"Output a library">;
  296. def Fc : JoinedOrSeparate<["-", "/"], "Fc">, MetaVarName<"<file>">, HelpText<"Output assembly code listing file">, Flags<[DriverOption]>, Group<hlslcomp_Group>;
  297. //def Fx : JoinedOrSeparate<["-", "/"], "Fx">, MetaVarName<"<file>">, HelpText<"Output assembly code and hex listing file">;
  298. def Fh : JoinedOrSeparate<["-", "/"], "Fh">, MetaVarName<"<file>">, HelpText<"Output header file containing object code">, Flags<[DriverOption]>, Group<hlslcomp_Group>;
  299. def Fe : JoinedOrSeparate<["-", "/"], "Fe">, MetaVarName<"<file>">, HelpText<"Output warnings and errors to the given file">, Flags<[DriverOption]>, Group<hlslcomp_Group>;
  300. def Fd : JoinedOrSeparate<["-", "/"], "Fd">, MetaVarName<"<file>">, HelpText<"Write debug information to the given file or directory; trail \\ to auto-generate and imply Qstrip_priv">, Flags<[DriverOption]>, Group<hlslcomp_Group>;
  301. def Vn : JoinedOrSeparate<["-", "/"], "Vn">, MetaVarName<"<name>">, HelpText<"Use <name> as variable name in header file">, Flags<[DriverOption]>, Group<hlslcomp_Group>;
  302. def Cc : Flag<["-", "/"], "Cc">, HelpText<"Output color coded assembly listings">, Group<hlslcomp_Group>, Flags<[DriverOption]>;
  303. def Ni : Flag<["-", "/"], "Ni">, HelpText<"Output instruction numbers in assembly listings">, Group<hlslcomp_Group>, Flags<[DriverOption]>;
  304. def No : Flag<["-", "/"], "No">, HelpText<"Output instruction byte offsets in assembly listings">, Group<hlslcomp_Group>, Flags<[DriverOption]>;
  305. def Lx : Flag<["-", "/"], "Lx">, HelpText<"Output hexadecimal literals">, Group<hlslcomp_Group>, Flags<[DriverOption]>;
  306. // In place of 'E' for clang; fxc uses 'E' for entry point.
  307. def P : Separate<["-", "/"], "P">, Flags<[DriverOption]>, Group<hlslutil_Group>,
  308. HelpText<"Preprocess to file (must be used alone)">;
  309. // @<file> - options response file
  310. def dumpbin : Flag<["-", "/"], "dumpbin">, Flags<[DriverOption]>, Group<hlslutil_Group>,
  311. HelpText<"Load a binary file rather than compiling">;
  312. def Qstrip_reflect : Flag<["-", "/"], "Qstrip_reflect">, Flags<[DriverOption]>, Group<hlslutil_Group>,
  313. HelpText<"Strip reflection data from shader bytecode (must be used with /Fo <file>)">;
  314. def Qstrip_debug : Flag<["-", "/"], "Qstrip_debug">, Flags<[CoreOption]>, Group<hlslutil_Group>,
  315. HelpText<"Strip debug information from 4_0+ shader bytecode (must be used with /Fo <file>)">;
  316. def Qstrip_priv : Flag<["-", "/"], "Qstrip_priv">, Flags<[DriverOption]>, Group<hlslutil_Group>,
  317. HelpText<"Strip private data from shader bytecode (must be used with /Fo <file>)">;
  318. def Qstrip_rootsignature : Flag<["-", "/"], "Qstrip_rootsignature">, Flags<[DriverOption]>, Group<hlslutil_Group>, HelpText<"Strip root signature data from shader bytecode (must be used with /Fo <file>)">;
  319. def setrootsignature : JoinedOrSeparate<["-", "/"], "setrootsignature">, MetaVarName<"<file>">, Flags<[DriverOption]>, Group<hlslutil_Group>, HelpText<"Attach root signature to shader bytecode">;
  320. def extractrootsignature : Flag<["-", "/"], "extractrootsignature">, Flags<[DriverOption]>, Group<hlslutil_Group>, HelpText<"Extract root signature from shader bytecode (must be used with /Fo <file>)">;
  321. def verifyrootsignature : JoinedOrSeparate<["-", "/"], "verifyrootsignature">, MetaVarName<"<file>">, Flags<[DriverOption]>, Group<hlslutil_Group>, HelpText<"Verify shader bytecode with root signature">;
  322. def force_rootsig_ver : JoinedOrSeparate<["-", "/"], "force_rootsig_ver">, Flags<[CoreOption]>, MetaVarName<"<profile>">, Group<hlslcomp_Group>, HelpText<"force root signature version (rootsig_1_1 if omitted)">;
  323. /*
  324. def shtemplate : JoinedOrSeparate<["-", "/"], "shtemplate">, MetaVarName<"<file>">, Group<hlslcomp_Group>,
  325. HelpText<"Template shader file for merging/matching resources">;
  326. def mergeUAVs : JoinedOrSeparate<["-", "/"], "mergeUAVs">, MetaVarName<"<file>">, Group<hlslcomp_Group>,
  327. HelpText<"Merge UAV slots of template shader and current shader">;
  328. def matchUAVs : JoinedOrSeparate<["-", "/"], "matchUAVs">, MetaVarName<"<file>">, Group<hlslcomp_Group>,
  329. HelpText<"Match template shader UAV slots in current shader">;
  330. def res_may_alias : Flag<["-", "/"], "res_may_alias">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  331. HelpText<"Assume that UAVs/SRVs may alias">;
  332. def enable_unbounded_descriptor_tables : Flag<["-", "/"], "enable_unbounded_descriptor_tables">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  333. HelpText<"Enables unbounded descriptor tables">;
  334. */
  335. def all_resources_bound : Flag<["-", "/"], "all_resources_bound">, Flags<[CoreOption]>, Group<hlslcomp_Group>,
  336. HelpText<"Enables agressive flattening">;
  337. def setprivate : JoinedOrSeparate<["-", "/"], "setprivate">, Flags<[DriverOption]>, MetaVarName<"<file>">, Group<hlslutil_Group>,
  338. HelpText<"Private data to add to compiled shader blob">;
  339. def getprivate : JoinedOrSeparate<["-", "/"], "getprivate">, Flags<[DriverOption]>, MetaVarName<"<file>">, Group<hlslutil_Group>,
  340. HelpText<"Save private data from shader blob">;
  341. def nologo : Flag<["-", "/"], "nologo">, Group<hlslcore_Group>, Flags<[DriverOption]>,
  342. HelpText<"Suppress copyright message">;
  343. // Also removed: compress, decompress, /Gch (child effect), /Gpp (partial precision)
  344. // /Op - no support for preshaders.
  345. def flegacy_macro_expansion : Flag<["-"], "flegacy-macro-expansion">, Group<hlslcomp_Group>, Flags<[CoreOption, DriverOption]>,
  346. HelpText<"Expand the operands before performing token-pasting operation (fxc behavior)">;