yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
99de1a620
master
Slang Command Line Options
Usage:
slangc [options...] [--] <input files> # For help slangc -h # To generate this file slangc -help-style markdown -h
Quick Links
- General
- Target
- Downstream
- Debugging
- Repro
- Experimental
- Internal
- Deprecated
- compiler
- language
- language-version
- archive-type
- line-directive-mode
- debug-info-format
- fp-mode
- fp-denormal-mode
- help-style
- optimization-level
- debug-level
- file-system-type
- source-embed-style
- target
- stage
- vulkan-shift
- capability
- file-extension
- help-category
<a id="General"></a>
General
General options
<a id="D"></a>
-D
-D<name>[=<value>], -D <name>[=<value>]
Insert a preprocessor macro.
The space between - D and <name> is optional. If no <value> is specified, Slang will define the macro with an empty value.
<a id="depfile"></a>
-depfile
-depfile <path>
Save the source file dependency list in a file.
<a id="entry"></a>
-entry
-entry <name>
Specify the name of an entry-point function.
When compiling from a single file, this defaults to main if you specify a stage using -stage.
Multiple -entry options may be used in a single invocation. When they do, the file associated with the entry point will be the first one found when searching to the left in the command line.
If no -entry options are given, compiler will use [shader(...)] attributes to detect entry points.
<a id="specialize"></a>
-specialize
-specialize <typename>
Specialize the last entrypoint with <typename>.
<a id="emit-ir"></a>
-emit-ir
Emit IR typically as a '.slang-module' when outputting to a container.
<a id="h"></a>
-h, -help, --help
-h or -h <help-category>
Print this message, or help in specified category.
<a id="help-style-1"></a>
-help-style
-help-style <help-style>
Help formatting style
<a id="I"></a>
-I
-I<path>, -I <path>
Add a path to be used in resolving '#include' and 'import' operations.
<a id="lang"></a>
-lang
-lang <language>
Set the language for the following input files.
<a id="matrix-layout-column-major"></a>
-matrix-layout-column-major
Set the default matrix layout to column-major.
<a id="matrix-layout-row-major"></a>
-matrix-layout-row-major
Set the default matrix layout to row-major.
<a id="restrictive-capability-check"></a>
-restrictive-capability-check
Many capability warnings will become an error.
<a id="ignore-capabilities"></a>
-ignore-capabilities
Do not warn or error if capabilities are violated
<a id="minimum-slang-optimization"></a>
-minimum-slang-optimization
Perform minimum code optimization in Slang to favor compilation time.
<a id="disable-non-essential-validations"></a>
-disable-non-essential-validations
Disable non-essential IR validations such as use of uninitialized variables.
<a id="disable-source-map"></a>
-disable-source-map
Disable source mapping in the Obfuscation.
<a id="module-name"></a>
-module-name
-module-name <name>
Set the module name to use when compiling multiple .slang source files into a single module.
<a id="o"></a>
-o
-o <path>
Specify a path where generated output should be written.
If no -target or -stage is specified, one may be inferred from file extension (see <file-extension>). If multiple -target options and a single -entry are present, each -o associates with the first -target to its left. Otherwise, if multiple -entry options are present, each -o associates with the first -entry to its left, and with the -target that matches the one inferred from <path>.
<a id="profile"></a>
-profile
-profile <profile>[+<capability>...]
Specify the shader profile for code generation.
Accepted profiles are:
-
sm_{4_0,4_1,5_0,5_1,6_0,6_1,6_2,6_3,6_4,6_5,6_6}
-
glsl_{110,120,130,140,150,330,400,410,420,430,440,450,460}
Additional profiles that include -stage information:
- {vs,hs,ds,gs,ps}_<version>
See -capability for information on <capability>
When multiple -target options are present, each -profile associates with the first -target to its left.
<a id="stage-1"></a>
-stage
-stage <stage>
Specify the stage of an entry-point function.
When multiple -entry options are present, each -stage associated with the first -entry to its left.
May be omitted if entry-point function has a [shader(...)] attribute; otherwise required for each -entry option.
<a id="target-1"></a>
-target
-target <target>
Specifies the format in which code should be generated.
<a id="v"></a>
-v, -version
Display the build version. This is the contents of git describe --tags.
It is typically only set from automated builds(such as distros available on github).A user build will by default be 'unknown'.
<a id="std"></a>
-std
-std <language-version>
Specifies the language standard that should be used.
<a id="warnings-as-errors"></a>
-warnings-as-errors
-warnings-as-errors all or -warnings-as-errors <id>[,<id>...]
all - Treat all warnings as errors.
<id>[,<id>...]: Treat specific warning ids as errors.
<a id="warnings-disable"></a>
-warnings-disable
-warnings-disable <id>[,<id>...]
Disable specific warning ids.
<a id="W"></a>
-W
-W<id>
Enable a warning with the specified id.
<a id="Wno"></a>
-Wno-
-Wno-<id>
Disable warning with <id>
<a id="dump-warning-diagnostics"></a>
-dump-warning-diagnostics
Dump to output list of warning diagnostic numeric and name ids.
<a id="id"></a>
--
Treat the rest of the command line as input files.
<a id="report-downstream-time"></a>
-report-downstream-time
Reports the time spent in the downstream compiler.
<a id="report-perf-benchmark"></a>
-report-perf-benchmark
Reports compiler performance benchmark results.
<a id="report-checkpoint-intermediates"></a>
-report-checkpoint-intermediates
Reports information about checkpoint contexts used for reverse-mode automatic differentiation.
<a id="skip-spirv-validation"></a>
-skip-spirv-validation
Skips spirv validation.
<a id="source-embed-style-1"></a>
-source-embed-style
-source-embed-style <source-embed-style>
If source embedding is enabled, defines the style used. When enabled (with any style other than none), will write compile results into embeddable source for the target language. If no output file is specified, the output is written to stdout. If an output file is specified it is written either to that file directly (if it is appropriate for the target language), or it will be output to the filename with an appropriate extension.
Note for C/C++ with u16/u32/u64 types it is necessary to have "#include <stdint.h>" before the generated file.
<a id="source-embed-name"></a>
-source-embed-name
-source-embed-name <name>
The name used as the basis for variables output for source embedding.
<a id="source-embed-language"></a>
-source-embed-language
-source-embed-language <language>
The language to be used for source embedding. Defaults to C/C++. Currently only C/C++ are supported
<a id="disable-short-circuit"></a>
-disable-short-circuit
Disable short-circuiting for "&&" and "||" operations
<a id="unscoped-enum"></a>
-unscoped-enum
Treat enums types as unscoped by default.
<a id="preserve-params"></a>
-preserve-params
Preserve all resource parameters in the output code, even if they are not used by the shader.
<a id="conformance"></a>
-conformance
-conformance <typeName>:<interfaceName>[=<sequentialID>]
Include additional type conformance during linking for dynamic dispatch.
<a id="reflection-json"></a>
-reflection-json
-reflection-json <path>
Emit reflection data in JSON format to a file.
<a id="msvc-style-bitfield-packing"></a>
-msvc-style-bitfield-packing
Pack bitfields according to MSVC rules (msb first, new field when underlying type size changes) rather than gcc-style (lsb first)
<a id="Target"></a>
Target
Target code generation options
<a id="capability-1"></a>
-capability
-capability <capability>[+<capability>...]
Add optional capabilities to a code generation target. See Capabilities below.
<a id="default-image-format-unknown"></a>
-default-image-format-unknown
Set the format of R/W images with unspecified format to 'unknown'. Otherwise try to guess the format.
<a id="disable-dynamic-dispatch"></a>
-disable-dynamic-dispatch
Disables generating dynamic dispatch code.
<a id="disable-specialization"></a>
-disable-specialization
Disables generics and specialization pass.
<a id="fp-mode-1"></a>
-fp-mode, -floating-point-mode
-fp-mode <fp-mode>, -floating-point-mode <fp-mode>
Control floating point optimizations
<a id="denorm-mode-fp16"></a>
-denorm-mode-fp16
-denorm-mode-fp16 <fp-denormal-mode>
Control handling of 16-bit denormal floating point values in SPIR-V (any, preserve, ftz)
<a id="denorm-mode-fp32"></a>
-denorm-mode-fp32
-denorm-mode-fp32 <fp-denormal-mode>
Control handling of 32-bit denormal floating point values in SPIR-V and DXIL (any, preserve, ftz)
<a id="denorm-mode-fp64"></a>
-denorm-mode-fp64
-denorm-mode-fp64 <fp-denormal-mode>
Control handling of 64-bit denormal floating point values in SPIR-V (any, preserve, ftz)
<a id="g"></a>
-g
-g, -g<debug-info-format>, -g<debug-level>
Include debug information in the generated code, where possible.
<debug-level> is the amount of information, 0..3, unspecified means 2
<debug-info-format> specifies a debugging info format
It is valid to have multiple -g options, such as a <debug-level> and a <debug-info-format>
<a id="line-directive-mode-1"></a>
-line-directive-mode
-line-directive-mode <line-directive-mode>
Sets how the #line directives should be produced. Available options are:
If not specified, default behavior is to use C-style #line directives for HLSL and C/C++ output, and traditional GLSL-style #line directives for GLSL output.
<a id="O"></a>
-O
Set the optimization level.
<a id="obfuscate"></a>
-obfuscate
Remove all source file information from outputs.
<a id="force-glsl-scalar-layout"></a>
-force-glsl-scalar-layout, -fvk-use-scalar-layout
Make data accessed through ConstantBuffer, ParameterBlock, StructuredBuffer, ByteAddressBuffer and general pointers follow the 'scalar' layout when targeting GLSL or SPIRV.
<a id="fvk-use-dx-layout"></a>
-fvk-use-dx-layout
Pack members using FXCs member packing rules when targeting GLSL or SPIRV.
<a id="fvk-use-c-layout"></a>
-fvk-use-c-layout
Make data accessed through ConstantBuffer, ParameterBlock, StructuredBuffer, ByteAddressBuffer and general pointers follow the C/C++ structure layout rules when targeting SPIRV.
<a id="fvk-b-shift"></a>
-fvk-b-shift, -fvk-s-shift, -fvk-t-shift, -fvk-u-shift
-fvk-<vulkan-shift>-shift <N> <space>
For example '-fvk-b-shift <N> <space>' shifts by N the inferred binding numbers for all resources in 'b' registers of space <space>. For a resource attached with :register(bX, <space>) but not [vk::binding(...)], sets its Vulkan descriptor set to <space> and binding number to X + N. If you need to shift the inferred binding numbers for more than one space, provide more than one such option. If more than one such option is provided for the same space, the last one takes effect. If you need to shift the inferred binding numbers for all sets, use 'all' as <space>.
-
[DXC description](https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/SPIR-V.rst#implicit-binding-number-assignment)
-
[GLSL wiki](https://github.com/KhronosGroup/glslang/wiki/HLSL-FAQ#auto-mapped-binding-numbers)
<a id="fvk-bind-globals"></a>
-fvk-bind-globals
-fvk-bind-globals <N> <descriptor-set>
Places the $Globals cbuffer at descriptor set <descriptor-set> and binding <N>.
It lets you specify the descriptor for the source at a certain register.
- [DXC description](https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/SPIR-V.rst#implicit-binding-number-assignment)
<a id="fvk-invert-y"></a>
-fvk-invert-y
Negates (additively inverts) SV_Position.y before writing to stage output.
<a id="fvk-use-dx-position-w"></a>
-fvk-use-dx-position-w
Reciprocates (multiplicatively inverts) SV_Position.w after reading from stage input. For use in fragment shaders only.
<a id="fvk-use-entrypoint-name"></a>
-fvk-use-entrypoint-name
Uses the entrypoint name from the source instead of 'main' in the spirv output.
<a id="fvk-use-gl-layout"></a>
-fvk-use-gl-layout
Use std430 layout instead of D3D buffer layout for raw buffer load/stores.
<a id="fspv-reflect"></a>
-fspv-reflect
Include reflection decorations in the resulting SPIRV for shader parameters.
<a id="enable-effect-annotations"></a>
-enable-effect-annotations
Enables support for legacy effect annotation syntax.
<a id="emit-spirv-via-glsl"></a>
-emit-spirv-via-glsl
Generate SPIR-V output by compiling generated GLSL with glslang
<a id="emit-spirv-directly"></a>
-emit-spirv-directly
Generate SPIR-V output directly (default)
<a id="spirv-core-grammar"></a>
-spirv-core-grammar
A path to a specific spirv.core.grammar.json to use when generating SPIR-V output
<a id="incomplete-library"></a>
-incomplete-library
Allow generating code from incomplete libraries with unresolved external functions
<a id="bindless-space-index"></a>
-bindless-space-index
-bindless-space-index <index>
Specify the space index for the system defined global bindless resource array.
<a id="separate-debug-info"></a>
-separate-debug-info
Emit debug data to a separate file, and strip it from the main output file.
<a id="Downstream"></a>
Downstream
Downstream compiler options
<a id="none-path"></a>
-none-path, -fxc-path, -dxc-path, -glslang-path, -spirv-dis-path, -clang-path, -visualstudio-path, -gcc-path, -genericcpp-path, -nvrtc-path, -llvm-path, -spirv-opt-path, -metal-path, -tint-path
-<compiler>-path <path>
Specify path to a downstream <compiler> executable or library.
<a id="default-downstream-compiler"></a>
-default-downstream-compiler
-default-downstream-compiler <language> <compiler>
Set a default compiler for the given language. See -lang for the list of languages.
<a id="X"></a>
-X
-X<compiler> <option> -X<compiler>... <options> -X.
Pass arguments to downstream <compiler>. Just -X<compiler> passes just the next argument to the downstream compiler. -X<compiler>... options -X. will pass all of the options inbetween the opening -X and -X. to the downstream compiler.
<a id="pass-through"></a>
-pass-through
-pass-through <compiler>
Pass the input through mostly unmodified to the existing compiler <compiler>.
These are intended for debugging/testing purposes, when you want to be able to see what these existing compilers do with the "same" input and options
<a id="Debugging"></a>
Debugging
Compiler debugging/instrumentation options
<a id="dump-ast"></a>
-dump-ast
Dump the AST to a .slang-ast file next to the input.
<a id="dump-intermediate-prefix"></a>
-dump-intermediate-prefix
-dump-intermediate-prefix <prefix>
File name prefix for -dump-intermediates outputs, default is no prefix
<a id="dump-intermediates"></a>
-dump-intermediates
Dump intermediate outputs for debugging.
<a id="dump-ir"></a>
-dump-ir
Dump the IR for debugging.
<a id="dump-ir-ids"></a>
-dump-ir-ids
Dump the IDs with -dump-ir (debug builds only)
<a id="E"></a>
-E, -output-preprocessor
Output the preprocessing result and exit.
<a id="no-codegen"></a>
-no-codegen
Skip the code generation step, just check the code and generate layout.
<a id="output-includes"></a>
-output-includes
Print the hierarchy of the processed source files.
<a id="serial-ir"></a>
-serial-ir
[REMOVED] Serialize the IR between front-end and back-end.
<a id="skip-codegen"></a>
-skip-codegen
Skip the code generation phase.
<a id="validate-ir"></a>
-validate-ir
Validate the IR between the phases.
<a id="verbose-paths"></a>
-verbose-paths
When displaying diagnostic output aim to display more detailed path information. In practice this is typically the complete 'canonical' path to the source file used.
<a id="verify-debug-serial-ir"></a>
-verify-debug-serial-ir
Verify IR in the front-end.
<a id="dump-module"></a>
-dump-module
Disassemble and print the module IR.
<a id="get-module-info"></a>
-get-module-info
Print the name and version of a serialized IR Module
<a id="get-supported-module-versions"></a>
-get-supported-module-versions
Print the minimum and maximum module versions this compiler supports
<a id="Repro"></a>
Repro
Slang repro system related
<a id="dump-repro-on-error"></a>
-dump-repro-on-error
Dump .slang-repro file on any compilation error.
<a id="extract-repro"></a>
-extract-repro
-extract-repro <name>
Extract the repro files into a folder.
<a id="load-repro-directory"></a>
-load-repro-directory
-load-repro-directory <path>
Use repro along specified path
<a id="load-repro"></a>
-load-repro
-load-repro <name>
Load repro
<a id="repro-file-system"></a>
-repro-file-system
-repro-file-system <name>
Use a repro as a file system
<a id="dump-repro"></a>
-dump-repro
Dump a .slang-repro file that can be used to reproduce a compilation on another machine.
<a id="repro-fallback-directory <path>"></a>
-repro-fallback-directory <path>
**Specify a directory to use if a file isn't found in a repro. Should be specified before any repro usage such as load-repro.
There are two special directories:
- 'none:' indicates no fallback, so if the file isn't found in the repro compliation will fail
- 'default:' is the default (which is the OS file system)**
<a id="Experimental"></a>
Experimental
Experimental options (use at your own risk)
<a id="file-system"></a>
-file-system
-file-system <file-system-type>
Set the filesystem hook to use for a compile request.
<a id="heterogeneous"></a>
-heterogeneous
Output heterogeneity-related code.
<a id="no-mangle"></a>
-no-mangle
Do as little mangling of names as possible.
<a id="no-hlsl-binding"></a>
-no-hlsl-binding
Do not include explicit parameter binding semantics in the output HLSL code,except for parameters that has explicit bindings in the input source.
<a id="no-hlsl-pack-constant-buffer-elements"></a>
-no-hlsl-pack-constant-buffer-elements
Do not pack elements of constant buffers into structs in the output HLSL code.
<a id="validate-uniformity"></a>
-validate-uniformity
Perform uniformity validation analysis.
<a id="allow-glsl"></a>
-allow-glsl
Enable GLSL as an input language.
<a id="enable-experimental-passes"></a>
-enable-experimental-passes
Enable experimental compiler passes
<a id="enable-experimental-dynamic-dispatch"></a>
-enable-experimental-dynamic-dispatch
Enable experimental dynamic dispatch features
<a id="embed-downstream-ir"></a>
-embed-downstream-ir
Embed downstream IR into emitted slang IR
<a id="Internal"></a>
Internal
Internal-use options (use at your own risk)
<a id="archive-type-1"></a>
-archive-type
-archive-type <archive-type>
Set the archive type for -save-core-module. Default is zip.
<a id="compile-core-module"></a>
-compile-core-module
Compile the core module from embedded sources. Will return a failure if there is already a core module available.
<a id="doc"></a>
-doc
Write documentation for -compile-core-module
<a id="ir-compression"></a>
-ir-compression
-ir-compression <type>
Set compression for IR and AST outputs.
Accepted compression types: none, lite
<a id="load-core-module"></a>
-load-core-module
-load-core-module <filename>
Load the core module from file.
<a id="r"></a>
-r
-r <name>
reference module <name>
<a id="save-core-module"></a>
-save-core-module
-save-core-module <filename>
Save the core module to an archive file.
<a id="save-core-module-bin-source"></a>
-save-core-module-bin-source
-save-core-module-bin-source <filename>
Same as -save-core-module but output the data as a C array.
<a id="save-glsl-module-bin-source"></a>
-save-glsl-module-bin-source
-save-glsl-module-bin-source <filename>
Save the serialized glsl module as a C array.
<a id="track-liveness"></a>
-track-liveness
Enable liveness tracking. Places SLANG_LIVE_START, and SLANG_LIVE_END in output source to indicate value liveness.
<a id="loop-inversion"></a>
-loop-inversion
Enable loop inversion in the code-gen optimization. Default is off
<a id="Deprecated"></a>
Deprecated
Deprecated options (allowed but ignored; may be removed in future)
<a id="parameter-blocks-use-register-spaces"></a>
-parameter-blocks-use-register-spaces
Parameter blocks will use register spaces
<a id="zero-initialize"></a>
-zero-initialize
Initialize all variables to zero.Structs will set all struct-fields without an init expression to 0.All variables will call their default constructor if not explicitly initialized as usual.
<a id="compiler"></a>
compiler
Downstream Compilers (aka Pass through)
none: Unknownfxc: FXC HLSL compilerdxc: DXC HLSL compilerglslang: GLSLANG GLSL compilerspirv-dis: spirv-tools SPIRV disassemblerclang: Clang C/C++ compilervisualstudio,vs: Visual Studio C/C++ compilergcc: GCC C/C++ compilergenericcpp,c,cpp: A generic C++ compiler (can be any one of visual studio, clang or gcc depending on system and availability)nvrtc: NVRTC CUDA compilerllvm: LLVM/Clangslang-llvmspirv-opt: spirv-tools SPIRV optimizermetal: Metal shader compilertint: Tint compiler
<a id="language"></a>
language
Language
c,C: C languagecpp,c++,C++,cxx: C++ languageslang: Slang languageglsl: GLSL languagehlsl: HLSL languagecu,cuda: CUDA
<a id="language-version"></a>
language-version
Language Version
legacy,default,2018: Legacy Slang language2025: Slang language rules for 2025 and older2026,latest: Slang language rules for 2026 and newer
<a id="archive-type"></a>
archive-type
Archive Type
riff-deflate: Slang RIFF using deflate compressionriff-lz4: Slang RIFF using LZ4 compressionzip: Zip fileriff: Slang RIFF without compression
<a id="line-directive-mode"></a>
line-directive-mode
Line Directive Mode
none: Don't emit#linedirectives at allsource-map: Use source map to track line associations (doen't emit #line)default: Default behaviorstandard: Emit standard C-style#linedirectives.glsl: Emit GLSL-style directives with file number instead of name.
<a id="debug-info-format"></a>
debug-info-format
Debug Info Format
default-format: Use the default debugging format for the targetc7: CodeView C7 format (typically means debugging infomation is embedded in the binary)pdb: Program databasestabs: STABS debug formatcoff: COFF debug formatdwarf: DWARF debug format
<a id="fp-mode"></a>
fp-mode
Floating Point Mode
precise: Disable optimization that could change the output of floating-point computations, including around infinities, NaNs, denormalized values, and negative zero. Prefer the most precise versions of special functions supported by the target.fast: Allow optimizations that may change results of floating-point computations. Prefer the fastest version of special functions supported by the target.default: Default floating point mode
<a id="fp-denormal-mode"></a>
fp-denormal-mode
Floating Point Denormal Handling Mode
any: Use any denormal handling mode (default). The mode used is implementation defined.preserve: Preserve denormal valuesftz: Flush denormals to zero
<a id="help-style"></a>
help-style
Help Style
text: Text suitable for output to a terminalmarkdown: Markdownno-link-markdown: Markdown without links
<a id="optimization-level"></a>
optimization-level
Optimization Level
0,none: Disable all optimizations1,default: Enable a default level of optimization.This is the default if no -o options are used.2,high: Enable aggressive optimizations for speed.3,maximal: Enable further optimizations, which might have a significant impact on compile time, or involve unwanted tradeoffs in terms of code size.
<a id="debug-level"></a>
debug-level
Debug Level
0,none: Don't emit debug information at all.1,minimal: Emit as little debug information as possible, while still supporting stack traces.2,standard: Emit whatever is the standard level of debug information for each target.3,maximal: Emit as much debug information as possible for each target.
<a id="file-system-type"></a>
file-system-type
File System Type
default: Default file system.load-file: Just implements loadFile interface, so will be wrapped with CacheFileSystem internally.os: Use the OS based file system directly (without file system caching)
<a id="source-embed-style"></a>
source-embed-style
Source Embed Style
none: No source level embeddingdefault: The default embedding for the type to be embeddedtext: Embed as text. May change line endings. If output isn't text will use 'default'. Size will not contain terminating 0.binary-text: Embed as text assuming contents is binary.u8: Embed as unsigned bytes.u16: Embed as uint16_t.u32: Embed as uint32_t.u64: Embed as uint64_t.
<a id="target"></a>
target
Target
unknownnonehlsl: HLSL source codedxbc: DirectX shader bytecode binarydxbc-asm,dxbc-assembly: DirectX shader bytecode assemblydxil: DirectX Intermediate Language binarydxil-asm,dxil-assembly: DirectX Intermediate Language assemblyglsl: GLSL(Vulkan) source codespirv: SPIR-V binaryspirv-asm,spirv-assembly: SPIR-V assemblyc: C source codecpp,c++,cxx: C++ source codetorch,torch-binding,torch-cpp,torch-cpp-binding: C++ for pytorch bindinghost-cpp,host-c++,host-cxx: C++ source for host executionexe,executable: Executable binaryshader-sharedlib,shader-sharedlibrary,shader-dll: Shared library/Dll for shader kernelsharedlib,sharedlibrary,dll: Shared library/Dll for host executioncuda,cu: CUDA source codeptx: PTX assemblycuobj,cubin: CUDA binaryhost-callable,callable: Host callableobject-code: Object codehost-host-callable: Host callable for host executionmetal: Metal shader sourcemetallib: Metal Library Bytecodemetallib-asm: Metal Library Bytecode assemblywgsl: WebGPU shading language sourcewgsl-spirv-asm,wgsl-spirv-assembly: SPIR-V assembly via WebGPU shading languagewgsl-spirv: SPIR-V via WebGPU shading languageslangvm,slang-vm: Slang VM byte code
<a id="stage"></a>
stage
Stage
vertexhull,tesscontroldomain,tessevalgeometrypixel,fragmentcomputeraygenerationintersectionanyhitclosesthitmisscallablemeshamplification,taskdispatch
<a id="vulkan-shift"></a>
vulkan-shift
Vulkan Shift
b: Constant buffer views: Samplert: Shader resource viewu: Unorderd access view
<a id="capability"></a>
capability
A capability describes an optional feature that a target may or may not support. When a -capability is specified, the compiler may assume that the target supports that capability, and generate code accordingly.
spirv_1_{ 0,1,2,3,4,5 }: minimum supported SPIR - V versiontextualTargethlslglslccppcudametalspirvwgslslangvmglsl_spirv_1_0glsl_spirv_1_1glsl_spirv_1_2glsl_spirv_1_3glsl_spirv_1_4glsl_spirv_1_5glsl_spirv_1_6metallib_2_3metallib_2_4metallib_3_0metallib_3_1hlsl_nvapihlsl_2018hlsl_coopvec_pocoptix_coopvecvertexfragmentcomputehulldomaingeometrydispatchSPV_EXT_fragment_shader_interlock: enables the SPV_EXT_fragment_shader_interlock extensionSPV_EXT_physical_storage_buffer: enables the SPV_EXT_physical_storage_buffer extensionSPV_EXT_fragment_fully_covered: enables the SPV_EXT_fragment_fully_covered extensionSPV_EXT_descriptor_indexing: enables the SPV_EXT_descriptor_indexing extensionSPV_EXT_shader_atomic_float_add: enables the SPV_EXT_shader_atomic_float_add extensionSPV_EXT_shader_atomic_float16_add: enables the SPV_EXT_shader_atomic_float16_add extensionSPV_EXT_shader_atomic_float_min_max: enables the SPV_EXT_shader_atomic_float_min_max extensionSPV_EXT_mesh_shader: enables the SPV_EXT_mesh_shader extensionSPV_EXT_demote_to_helper_invocation: enables the SPV_EXT_demote_to_helper_invocation extensionSPV_KHR_maximal_reconvergence: enables the SPV_KHR_maximal_reconvergence extensionSPV_KHR_quad_control: enables the SPV_KHR_quad_control extensionSPV_KHR_fragment_shader_barycentric: enables the SPV_KHR_fragment_shader_barycentric extensionSPV_KHR_non_semantic_info: enables the SPV_KHR_non_semantic_info extensionSPV_KHR_device_group: enables the SPV_KHR_device_group extensionSPV_KHR_ray_tracing: enables the SPV_KHR_ray_tracing extensionSPV_KHR_ray_query: enables the SPV_KHR_ray_query extensionSPV_KHR_ray_tracing_position_fetch: enables the SPV_KHR_ray_tracing_position_fetch extensionSPV_KHR_shader_clock: enables the SPV_KHR_shader_clock extensionSPV_NV_shader_subgroup_partitioned: enables the SPV_NV_shader_subgroup_partitioned extensionSPV_KHR_subgroup_rotate: enables the SPV_KHR_subgroup_rotate extensionSPV_NV_ray_tracing_motion_blur: enables the SPV_NV_ray_tracing_motion_blur extensionSPV_NV_shader_invocation_reorder: enables the SPV_NV_shader_invocation_reorder extensionSPV_NV_cluster_acceleration_structure: enables the SPV_NV_cluster_acceleration_structure extensionSPV_NV_linear_swept_spheres: enables the SPV_NV_linear_swept_spheres extensionSPV_NV_shader_image_footprint: enables the SPV_NV_shader_image_footprint extensionSPV_KHR_compute_shader_derivatives: enables the SPV_KHR_compute_shader_derivatives extensionSPV_GOOGLE_user_type: enables the SPV_GOOGLE_user_type extensionSPV_EXT_replicated_composites: enables the SPV_EXT_replicated_composites extensionSPV_KHR_vulkan_memory_model: enables the SPV_KHR_vulkan_memory_model extensionSPV_NV_cooperative_vector: enables the SPV_NV_cooperative_vector extensionSPV_KHR_cooperative_matrix: enables the SPV_KHR_cooperative_matrix extensionSPV_NV_tensor_addressing: enables the SPV_NV_tensor_addressing extensionSPV_NV_cooperative_matrix2: enables the SPV_NV_cooperative_matrix2 extensionSPV_NV_bindless_texture: enables the SPV_NV_bindless_texture extensionspvDeviceGroupspvAtomicFloat32AddEXTspvAtomicFloat16AddEXTspvAtomicFloat64AddEXTspvInt64AtomicsspvAtomicFloat32MinMaxEXTspvAtomicFloat16MinMaxEXTspvAtomicFloat64MinMaxEXTspvDerivativeControlspvImageQueryspvImageGatherExtendedspvSparseResidencyspvImageFootprintNVspvMinLodspvFragmentShaderPixelInterlockEXTspvFragmentBarycentricKHRspvFragmentFullyCoveredEXTspvGroupNonUniformBallotspvGroupNonUniformShufflespvGroupNonUniformArithmeticspvGroupNonUniformQuadspvGroupNonUniformVotespvGroupNonUniformPartitionedNVspvGroupNonUniformRotateKHRspvRayTracingMotionBlurNVspvMeshShadingEXTspvRayTracingKHRspvRayTracingPositionFetchKHRspvRayQueryKHRspvRayQueryPositionFetchKHRspvShaderInvocationReorderNVspvRayTracingClusterAccelerationStructureNVspvRayTracingLinearSweptSpheresGeometryNVspvShaderClockKHRspvShaderNonUniformEXTspvShaderNonUniformspvDemoteToHelperInvocationEXTspvDemoteToHelperInvocationspvReplicatedCompositesEXTspvCooperativeVectorNVspvCooperativeVectorTrainingNVspvCooperativeMatrixKHRspvCooperativeMatrixReductionsNVspvCooperativeMatrixConversionsNVspvCooperativeMatrixPerElementOperationsNVspvCooperativeMatrixTensorAddressingNVspvCooperativeMatrixBlockLoadsNVspvTensorAddressingNVspvMaximalReconvergenceKHRspvQuadControlKHRspvVulkanMemoryModelKHRspvVulkanMemoryModelDeviceScopeKHRspvBindlessTextureNVmetallib_latestdxil_libany_targetany_textual_targetany_gfx_targetany_cpp_targetcpp_cudacpp_cuda_spirvcpp_cuda_metal_spirvcuda_spirvcpp_cuda_glsl_spirvcpp_cuda_glsl_hlslcpp_cuda_glsl_hlsl_spirvcpp_cuda_glsl_hlsl_spirv_wgslcpp_cuda_glsl_hlsl_metal_spirvcpp_cuda_glsl_hlsl_metal_spirv_wgslcpp_cuda_hlslcpp_cuda_hlsl_spirvcpp_cuda_hlsl_metal_spirvcpp_glslcpp_glsl_hlsl_spirvcpp_glsl_hlsl_spirv_wgslcpp_glsl_hlsl_metal_spirvcpp_glsl_hlsl_metal_spirv_wgslcpp_hlslcuda_glsl_hlslcuda_hlsl_metal_spirvcuda_glsl_hlsl_spirvcuda_glsl_hlsl_spirv_wgslcuda_glsl_hlsl_metal_spirvcuda_glsl_hlsl_metal_spirv_wgslcuda_glsl_spirvcuda_glsl_metal_spirvcuda_glsl_metal_spirv_wgslcuda_hlslcuda_hlsl_spirvglsl_hlsl_spirvglsl_hlsl_spirv_wgslglsl_hlsl_metal_spirvglsl_hlsl_metal_spirv_wgslglsl_metal_spirvglsl_metal_spirv_wgslglsl_spirvglsl_spirv_wgslhlsl_spirvSPV_NV_compute_shader_derivatives: enables the SPV_NV_compute_shader_derivatives extensionGL_EXT_buffer_reference: enables the GL_EXT_buffer_reference extensionGL_EXT_buffer_reference_uvec2: enables the GL_EXT_buffer_reference_uvec2 extensionGL_EXT_debug_printf: enables the GL_EXT_debug_printf extensionGL_EXT_demote_to_helper_invocation: enables the GL_EXT_demote_to_helper_invocation extensionGL_EXT_maximal_reconvergence: enables the GL_EXT_maximal_reconvergence extensionGL_EXT_shader_quad_control: enables the GL_EXT_shader_quad_control extensionGL_EXT_device_group: enables the GL_EXT_device_group extensionGL_EXT_fragment_shader_barycentric: enables the GL_EXT_fragment_shader_barycentric extensionGL_EXT_mesh_shader: enables the GL_EXT_mesh_shader extensionGL_EXT_nonuniform_qualifier: enables the GL_EXT_nonuniform_qualifier extensionGL_EXT_ray_query: enables the GL_EXT_ray_query extensionGL_EXT_ray_tracing: enables the GL_EXT_ray_tracing extensionGL_EXT_ray_tracing_position_fetch_ray_tracing: enables the GL_EXT_ray_tracing_position_fetch_ray_tracing extensionGL_EXT_ray_tracing_position_fetch_ray_query: enables the GL_EXT_ray_tracing_position_fetch_ray_query extensionGL_EXT_ray_tracing_position_fetch: enables the GL_EXT_ray_tracing_position_fetch extensionGL_EXT_samplerless_texture_functions: enables the GL_EXT_samplerless_texture_functions extensionGL_EXT_shader_atomic_float: enables the GL_EXT_shader_atomic_float extensionGL_EXT_shader_atomic_float_min_max: enables the GL_EXT_shader_atomic_float_min_max extensionGL_EXT_shader_atomic_float2: enables the GL_EXT_shader_atomic_float2 extensionGL_EXT_shader_atomic_int64: enables the GL_EXT_shader_atomic_int64 extensionGL_EXT_shader_explicit_arithmetic_types: enables the GL_EXT_shader_explicit_arithmetic_types extensionGL_EXT_shader_explicit_arithmetic_types_int64: enables the GL_EXT_shader_explicit_arithmetic_types_int64 extensionGL_EXT_shader_image_load_store: enables the GL_EXT_shader_image_load_store extensionGL_EXT_shader_realtime_clock: enables the GL_EXT_shader_realtime_clock extensionGL_EXT_texture_query_lod: enables the GL_EXT_texture_query_lod extensionGL_EXT_texture_shadow_lod: enables the GL_EXT_texture_shadow_lod extensionGL_ARB_derivative_control: enables the GL_ARB_derivative_control extensionGL_ARB_fragment_shader_interlock: enables the GL_ARB_fragment_shader_interlock extensionGL_ARB_gpu_shader5: enables the GL_ARB_gpu_shader5 extensionGL_ARB_shader_image_load_store: enables the GL_ARB_shader_image_load_store extensionGL_ARB_shader_image_size: enables the GL_ARB_shader_image_size extensionGL_ARB_texture_multisample: enables the GL_ARB_texture_multisample extensionGL_ARB_shader_texture_image_samples: enables the GL_ARB_shader_texture_image_samples extensionGL_ARB_sparse_texture: enables the GL_ARB_sparse_texture extensionGL_ARB_sparse_texture2: enables the GL_ARB_sparse_texture2 extensionGL_ARB_sparse_texture_clamp: enables the GL_ARB_sparse_texture_clamp extensionGL_ARB_texture_gather: enables the GL_ARB_texture_gather extensionGL_ARB_texture_query_levels: enables the GL_ARB_texture_query_levels extensionGL_ARB_shader_clock: enables the GL_ARB_shader_clock extensionGL_ARB_shader_clock64: enables the GL_ARB_shader_clock64 extensionGL_ARB_gpu_shader_int64: enables the GL_ARB_gpu_shader_int64 extensionGL_KHR_memory_scope_semantics: enables the GL_KHR_memory_scope_semantics extensionGL_KHR_shader_subgroup_arithmetic: enables the GL_KHR_shader_subgroup_arithmetic extensionGL_KHR_shader_subgroup_ballot: enables the GL_KHR_shader_subgroup_ballot extensionGL_KHR_shader_subgroup_basic: enables the GL_KHR_shader_subgroup_basic extensionGL_KHR_shader_subgroup_clustered: enables the GL_KHR_shader_subgroup_clustered extensionGL_KHR_shader_subgroup_quad: enables the GL_KHR_shader_subgroup_quad extensionGL_KHR_shader_subgroup_shuffle: enables the GL_KHR_shader_subgroup_shuffle extensionGL_KHR_shader_subgroup_shuffle_relative: enables the GL_KHR_shader_subgroup_shuffle_relative extensionGL_KHR_shader_subgroup_vote: enables the GL_KHR_shader_subgroup_vote extensionGL_KHR_shader_subgroup_rotate: enables the GL_KHR_shader_subgroup_rotate extensionGL_NV_compute_shader_derivatives: enables the GL_NV_compute_shader_derivatives extensionGL_NV_fragment_shader_barycentric: enables the GL_NV_fragment_shader_barycentric extensionGL_NV_gpu_shader5: enables the GL_NV_gpu_shader5 extensionGL_NV_ray_tracing: enables the GL_NV_ray_tracing extensionGL_NV_ray_tracing_motion_blur: enables the GL_NV_ray_tracing_motion_blur extensionGL_NV_shader_atomic_fp16_vector: enables the GL_NV_shader_atomic_fp16_vector extensionGL_NV_shader_invocation_reorder: enables the GL_NV_shader_invocation_reorder extensionGL_NV_shader_subgroup_partitioned: enables the GL_NV_shader_subgroup_partitioned extensionGL_NV_shader_texture_footprint: enables the GL_NV_shader_texture_footprint extensionGL_NV_cluster_acceleration_structure: enables the GL_NV_cluster_acceleration_structure extensionGL_NV_cooperative_vector: enables the GL_NV_cooperative_vector extensionnvapiraytracingsermotionblurrayqueryraytracing_motionblurser_motionshaderclockfragmentshaderinterlockatomic64atomicfloatatomicfloat2fragmentshaderbarycentricshadermemorycontrolbufferreferencebufferreference_int64cooperative_vectorcooperative_vector_trainingcooperative_matrixcooperative_matrix_reductioncooperative_matrix_conversioncooperative_matrix_map_elementcooperative_matrix_tensor_addressingcooperative_matrix_block_loadtensor_addressingcooperative_matrix_2vk_mem_modelpixeltesscontroltessevalraygenraygenerationintersectionanyhitclosesthitcallablemissmeshtaskamplificationany_stageamplification_meshraytracing_stagesanyhit_closesthitraygen_closesthit_missanyhit_closesthit_intersectionanyhit_closesthit_intersection_missraygen_closesthit_miss_callablecompute_tesscontrol_tessevalcompute_fragmentcompute_fragment_geometry_vertexdomain_hullraytracingstages_fragmentraytracingstages_computeraytracingstages_compute_amplification_meshraytracingstages_compute_fragmentraytracingstages_compute_fragment_geometry_vertexmeshshadingshadermemorycontrol_computesubpassspirv_latestSPIRV_1_0SPIRV_1_1SPIRV_1_2SPIRV_1_3SPIRV_1_4SPIRV_1_5SPIRV_1_6sm_4_0_versionsm_4_0sm_4_1_versionsm_4_1sm_5_0_versionsm_5_0sm_5_1_versionsm_5_1sm_6_0_versionsm_6_0sm_6_1_versionsm_6_1sm_6_2_versionsm_6_2sm_6_3_versionsm_6_3sm_6_4_versionsm_6_4sm_6_5_versionsm_6_5sm_6_6_versionsm_6_6sm_6_7_versionsm_6_7sm_6_8_versionsm_6_8sm_6_9_versionsm_6_9DX_4_0DX_4_1DX_5_0DX_5_1DX_6_0DX_6_1DX_6_2DX_6_3DX_6_4DX_6_5DX_6_6DX_6_7DX_6_8DX_6_9GLSL_130: enables the GLSL_130 extensionGLSL_140: enables the GLSL_140 extensionGLSL_150: enables the GLSL_150 extensionGLSL_330: enables the GLSL_330 extensionGLSL_400: enables the GLSL_400 extensionGLSL_410: enables the GLSL_410 extensionGLSL_420: enables the GLSL_420 extensionGLSL_430: enables the GLSL_430 extensionGLSL_440: enables the GLSL_440 extensionGLSL_450: enables the GLSL_450 extensionGLSL_460: enables the GLSL_460 extensionGLSL_410_SPIRV_1_0: enables the GLSL_410_SPIRV_1_0 extensionGLSL_420_SPIRV_1_0: enables the GLSL_420_SPIRV_1_0 extensionGLSL_430_SPIRV_1_0: enables the GLSL_430_SPIRV_1_0 extensioncuda_sm_1_0cuda_sm_2_0cuda_sm_3_0cuda_sm_3_5cuda_sm_4_0cuda_sm_5_0cuda_sm_6_0cuda_sm_7_0cuda_sm_8_0cuda_sm_9_0METAL_2_3METAL_2_4METAL_3_0METAL_3_1appendstructuredbufferatomic_hlslatomic_hlsl_nvapiatomic_hlsl_sm_6_6byteaddressbufferbyteaddressbuffer_rwconsumestructuredbufferstructuredbufferstructuredbuffer_rwfragmentprocessingfragmentprocessing_derivativecontrolgetattributeatvertexmemorybarriertexture_sm_4_0texture_sm_4_1texture_sm_4_1_samplerlesstexture_sm_4_1_compute_fragmenttexture_sm_4_0_fragmenttexture_sm_4_1_clamp_fragmenttexture_sm_4_1_vertex_fragment_geometrytexture_gatherimage_samplesimage_sizetexture_sizetexture_querylodtexture_querylevelstexture_shadowlodatomic_glsl_float1atomic_glsl_float2atomic_glsl_halfvecatomic_glslatomic_glsl_int64GLSL_430_SPIRV_1_0_compute: enables the GLSL_430_SPIRV_1_0_compute extensionimage_loadstorenonuniformqualifierprintftexturefootprinttexturefootprintclampshader5_sm_4_0shader5_sm_5_0pack_vectorsubgroup_basicsubgroup_ballotsubgroup_ballot_activemasksubgroup_basic_ballotsubgroup_voteshaderinvocationgroupsubgroup_arithmeticsubgroup_shufflesubgroup_shufflerelativesubgroup_clusteredsubgroup_quadsubgroup_partitionedsubgroup_rotateatomic_glsl_hlsl_nvapi_cuda_metal_float1atomic_glsl_hlsl_nvapi_cuda5_int64atomic_glsl_hlsl_nvapi_cuda6_int64atomic_glsl_hlsl_nvapi_cuda9_int64atomic_glsl_hlsl_cuda_metalatomic_glsl_hlsl_cuda9_int64helper_lanequad_controlbreakpointraytracing_allstagesraytracing_anyhitraytracing_intersectionraytracing_anyhit_closesthitraytracing_lssraytracing_lss_horaytracing_anyhit_closesthit_intersectionraytracing_raygen_closesthit_missraytracing_anyhit_closesthit_intersection_missraytracing_raygen_closesthit_miss_callableraytracing_positionraytracing_motionblur_anyhit_closesthit_intersection_missraytracing_motionblur_raygen_closesthit_missrayquery_positionser_raygenser_raygen_closesthit_missser_any_closesthit_intersection_missser_anyhit_closesthit_intersectionser_anyhit_closesthitser_motion_raygen_closesthit_missser_motion_raygenall
<a id="file-extension"></a>
file-extension
A <language>, <format>, and/or <stage> may be inferred from the extension of an input or -o path
hlsl,fx: hlsldxbcdxbc-asm: dxbc-assemblydxildxil-asm: dxil-assemblyglslvert: glsl (vertex)frag: glsl (fragment)geom: glsl (geoemtry)tesc: glsl (hull)tese: glsl (domain)comp: glsl (compute)mesh: glsl (mesh)task: glsl (amplification)slangspv: SPIR-Vspv-asm: SPIR-V assemblyccpp,c++,cxx: C++exe: executabledll,so: sharedlibrary/dllcu: CUDAptx: PTXobj,o: object-codezip: containerslang-module,slang-library: Slang Module/Librarydir: Container as a directory
<a id="help-category"></a>
help-category
Available help categories for the -h option
General: General optionsTarget: Target code generation optionsDownstream: Downstream compiler optionsDebugging: Compiler debugging/instrumentation optionsRepro: Slang repro system relatedExperimental: Experimental options (use at your own risk)Internal: Internal-use options (use at your own risk)Deprecated: Deprecated options (allowed but ignored; may be removed in future)compiler: Downstream Compilers (aka Pass through)language: Languagelanguage-version: Language Versionarchive-type: Archive Typeline-directive-mode: Line Directive Modedebug-info-format: Debug Info Formatfp-mode: Floating Point Modefp-denormal-mode: Floating Point Denormal Handling Modehelp-style: Help Styleoptimization-level: Optimization Leveldebug-level: Debug Levelfile-system-type: File System Typesource-embed-style: Source Embed Styletarget: Targetstage: Stagevulkan-shift: Vulkan Shiftcapability: A capability describes an optional feature that a target may or may not support. When a -capability is specified, the compiler may assume that the target supports that capability, and generate code accordingly.file-extension: A <language>, <format>, and/or <stage> may be inferred from the extension of an input or -o pathhelp-category: Available help categories for the -h option
1# Slang Command Line Options 2 3*Usage:* 4``` 5slangc [options...] [--] <input files> 6 7# For help 8slangc -h 9 10# To generate this file 11slangc -help-style markdown -h 12``` 13### Quick Links 14 15* [General](#General) 16* [Target](#Target) 17* [Downstream](#Downstream) 18* [Debugging](#Debugging) 19* [Repro](#Repro) 20* [Experimental](#Experimental) 21* [Internal](#Internal) 22* [Deprecated](#Deprecated) 23* [compiler](#compiler) 24* [language](#language) 25* [language-version](#language-version) 26* [archive-type](#archive-type) 27* [line-directive-mode](#line-directive-mode) 28* [debug-info-format](#debug-info-format) 29* [fp-mode](#fp-mode) 30* [fp-denormal-mode](#fp-denormal-mode) 31* [help-style](#help-style) 32* [optimization-level](#optimization-level) 33* [debug-level](#debug-level) 34* [file-system-type](#file-system-type) 35* [source-embed-style](#source-embed-style) 36* [target](#target) 37* [stage](#stage) 38* [vulkan-shift](#vulkan-shift) 39* [capability](#capability) 40* [file-extension](#file-extension) 41* [help-category](#help-category) 42 43<a id="General"></a> 44## General 45 46General options 47 48<a id="D"></a> 49### -D 50 51**-D<name>\[=<value>\], -D <name>\[=<value>\]** 52 53Insert a preprocessor macro. 54 55The space between - D and <name> is optional. If no <value> is specified, Slang will define the macro with an empty value. 56 57 58<a id="depfile"></a> 59### -depfile 60 61**-depfile <path>** 62 63Save the source file dependency list in a file. 64 65 66<a id="entry"></a> 67### -entry 68 69**-entry <name>** 70 71Specify the name of an entry-point function. 72 73When compiling from a single file, this defaults to main if you specify a stage using [-stage](#stage-1). 74 75Multiple [-entry](#entry) options may be used in a single invocation. When they do, the file associated with the entry point will be the first one found when searching to the left in the command line. 76 77If no [-entry](#entry) options are given, compiler will use \[shader(...)\] attributes to detect entry points. 78 79 80<a id="specialize"></a> 81### -specialize 82 83**-specialize <typename>** 84 85Specialize the last entrypoint with <typename>. 86 87 88 89 90<a id="emit-ir"></a> 91### -emit-ir 92Emit IR typically as a '.slang-module' when outputting to a container. 93 94 95<a id="h"></a> 96### -h, -help, --help 97 98**-h or -h <[help-category](#help-category)>** 99 100Print this message, or help in specified category. 101 102 103<a id="help-style-1"></a> 104### -help-style 105 106**-help-style <[help-style](#help-style)>** 107 108Help formatting style 109 110 111<a id="I"></a> 112### -I 113 114**-I<path>, -I <path>** 115 116Add a path to be used in resolving '#include' and 'import' operations. 117 118 119<a id="lang"></a> 120### -lang 121 122**-lang <[language](#language)>** 123 124Set the language for the following input files. 125 126 127<a id="matrix-layout-column-major"></a> 128### -matrix-layout-column-major 129Set the default matrix layout to column-major. 130 131 132<a id="matrix-layout-row-major"></a> 133### -matrix-layout-row-major 134Set the default matrix layout to row-major. 135 136 137<a id="restrictive-capability-check"></a> 138### -restrictive-capability-check 139Many capability warnings will become an error. 140 141 142<a id="ignore-capabilities"></a> 143### -ignore-capabilities 144Do not warn or error if capabilities are violated 145 146 147<a id="minimum-slang-optimization"></a> 148### -minimum-slang-optimization 149Perform minimum code optimization in Slang to favor compilation time. 150 151 152<a id="disable-non-essential-validations"></a> 153### -disable-non-essential-validations 154Disable non-essential IR validations such as use of uninitialized variables. 155 156 157<a id="disable-source-map"></a> 158### -disable-source-map 159Disable source mapping in the Obfuscation. 160 161 162<a id="module-name"></a> 163### -module-name 164 165**-module-name <name>** 166 167Set the module name to use when compiling multiple .slang source files into a single module. 168 169 170<a id="o"></a> 171### -o 172 173**-o <path>** 174 175Specify a path where generated output should be written. 176 177If no [-target](#target-1) or [-stage](#stage-1) is specified, one may be inferred from file extension (see [<file-extension>](#file-extension)). If multiple [-target](#target-1) options and a single [-entry](#entry) are present, each [-o](#o) associates with the first [-target](#target-1) to its left. Otherwise, if multiple [-entry](#entry) options are present, each [-o](#o) associates with the first [-entry](#entry) to its left, and with the [-target](#target-1) that matches the one inferred from <path>. 178 179 180<a id="profile"></a> 181### -profile 182 183**-profile <profile>\[+<[capability](#capability)>...\]** 184 185Specify the shader profile for code generation. 186 187Accepted profiles are: 188 189* sm_{4_0,4_1,5_0,5_1,6_0,6_1,6_2,6_3,6_4,6_5,6_6} 190 191* glsl_{110,120,130,140,150,330,400,410,420,430,440,450,460} 192 193Additional profiles that include [-stage](#stage-1) information: 194 195* {vs,hs,ds,gs,ps}_<version> 196 197See [-capability](#capability-1) for information on [<capability>](#capability) 198 199When multiple [-target](#target-1) options are present, each [-profile](#profile) associates with the first [-target](#target-1) to its left. 200 201 202<a id="stage-1"></a> 203### -stage 204 205**-stage <[stage](#stage)>** 206 207Specify the stage of an entry-point function. 208 209When multiple [-entry](#entry) options are present, each [-stage](#stage-1) associated with the first [-entry](#entry) to its left. 210 211May be omitted if entry-point function has a \[shader(...)\] attribute; otherwise required for each [-entry](#entry) option. 212 213 214<a id="target-1"></a> 215### -target 216 217**-target <[target](#target)>** 218 219Specifies the format in which code should be generated. 220 221 222<a id="v"></a> 223### -v, -version 224Display the build version. This is the contents of git describe --tags. 225 226It is typically only set from automated builds(such as distros available on github).A user build will by default be 'unknown'. 227 228 229<a id="std"></a> 230### -std 231 232**-std <[language-version](#language-version)>** 233 234Specifies the language standard that should be used. 235 236 237<a id="warnings-as-errors"></a> 238### -warnings-as-errors 239 240**-warnings-as-errors all or -warnings-as-errors <id>\[,<id>...\]** 241 242all - Treat all warnings as errors. 243 244<id>\[,<id>...\]: Treat specific warning ids as errors. 245 246 247 248 249<a id="warnings-disable"></a> 250### -warnings-disable 251 252**-warnings-disable <id>\[,<id>...\]** 253 254Disable specific warning ids. 255 256 257<a id="W"></a> 258### -W 259 260**-W<id>** 261 262Enable a warning with the specified id. 263 264 265<a id="Wno"></a> 266### -Wno- 267 268**-Wno-<id>** 269 270Disable warning with <id> 271 272 273<a id="dump-warning-diagnostics"></a> 274### -dump-warning-diagnostics 275Dump to output list of warning diagnostic numeric and name ids. 276 277 278<a id="id"></a> 279### -- 280Treat the rest of the command line as input files. 281 282 283<a id="report-downstream-time"></a> 284### -report-downstream-time 285Reports the time spent in the downstream compiler. 286 287 288<a id="report-perf-benchmark"></a> 289### -report-perf-benchmark 290Reports compiler performance benchmark results. 291 292 293<a id="report-checkpoint-intermediates"></a> 294### -report-checkpoint-intermediates 295Reports information about checkpoint contexts used for reverse-mode automatic differentiation. 296 297 298<a id="skip-spirv-validation"></a> 299### -skip-spirv-validation 300Skips spirv validation. 301 302 303<a id="source-embed-style-1"></a> 304### -source-embed-style 305 306**-source-embed-style <[source-embed-style](#source-embed-style)>** 307 308If source embedding is enabled, defines the style used. When enabled (with any style other than `none`), will write compile results into embeddable source for the target language. If no output file is specified, the output is written to stdout. If an output file is specified it is written either to that file directly (if it is appropriate for the target language), or it will be output to the filename with an appropriate extension. 309 310 311 312Note for C/C++ with u16/u32/u64 types it is necessary to have "#include <stdint.h>" before the generated file. 313 314 315 316 317<a id="source-embed-name"></a> 318### -source-embed-name 319 320**-source-embed-name <name>** 321 322The name used as the basis for variables output for source embedding. 323 324 325<a id="source-embed-language"></a> 326### -source-embed-language 327 328**-source-embed-language <[language](#language)>** 329 330The language to be used for source embedding. Defaults to C/C++. Currently only C/C++ are supported 331 332 333<a id="disable-short-circuit"></a> 334### -disable-short-circuit 335Disable short-circuiting for "&&" and "||" operations 336 337 338<a id="unscoped-enum"></a> 339### -unscoped-enum 340Treat enums types as unscoped by default. 341 342 343<a id="preserve-params"></a> 344### -preserve-params 345Preserve all resource parameters in the output code, even if they are not used by the shader. 346 347 348<a id="conformance"></a> 349### -conformance 350 351**-conformance <typeName>:<interfaceName>\[=<sequentialID>\]** 352 353Include additional type conformance during linking for dynamic dispatch. 354 355 356<a id="reflection-json"></a> 357### -reflection-json 358 359**-reflection-json <path>** 360 361Emit reflection data in JSON format to a file. 362 363 364<a id="msvc-style-bitfield-packing"></a> 365### -msvc-style-bitfield-packing 366Pack bitfields according to MSVC rules (msb first, new field when underlying type size changes) rather than gcc-style (lsb first) 367 368 369 370<a id="Target"></a> 371## Target 372 373Target code generation options 374 375<a id="capability-1"></a> 376### -capability 377 378**-capability <[capability](#capability)>\[+<[capability](#capability)>...\]** 379 380Add optional capabilities to a code generation target. See Capabilities below. 381 382 383<a id="default-image-format-unknown"></a> 384### -default-image-format-unknown 385Set the format of R/W images with unspecified format to 'unknown'. Otherwise try to guess the format. 386 387 388<a id="disable-dynamic-dispatch"></a> 389### -disable-dynamic-dispatch 390Disables generating dynamic dispatch code. 391 392 393<a id="disable-specialization"></a> 394### -disable-specialization 395Disables generics and specialization pass. 396 397 398<a id="fp-mode-1"></a> 399### -fp-mode, -floating-point-mode 400 401**-fp-mode <[fp-mode](#fp-mode)>, -floating-point-mode <[fp-mode](#fp-mode)>** 402 403Control floating point optimizations 404 405 406<a id="denorm-mode-fp16"></a> 407### -denorm-mode-fp16 408 409**-denorm-mode-fp16 <[fp-denormal-mode](#fp-denormal-mode)>** 410 411Control handling of 16-bit denormal floating point values in SPIR-V (any, preserve, ftz) 412 413 414<a id="denorm-mode-fp32"></a> 415### -denorm-mode-fp32 416 417**-denorm-mode-fp32 <[fp-denormal-mode](#fp-denormal-mode)>** 418 419Control handling of 32-bit denormal floating point values in SPIR-V and DXIL (any, preserve, ftz) 420 421 422<a id="denorm-mode-fp64"></a> 423### -denorm-mode-fp64 424 425**-denorm-mode-fp64 <[fp-denormal-mode](#fp-denormal-mode)>** 426 427Control handling of 64-bit denormal floating point values in SPIR-V (any, preserve, ftz) 428 429 430<a id="g"></a> 431### -g 432 433**-g, -g<[debug-info-format](#debug-info-format)>, -g<[debug-level](#debug-level)>** 434 435Include debug information in the generated code, where possible. 436 437[<debug-level>] (#debug-level) is the amount of information, 0..3, unspecified means 2 438 439[<debug-info-format>] (#debug-info-format) specifies a debugging info format 440 441It is valid to have multiple [-g](#g) options, such as a [<debug-level>](#debug-level) and a [<debug-info-format>](#debug-info-format) 442 443 444<a id="line-directive-mode-1"></a> 445### -line-directive-mode 446 447**-line-directive-mode <[line-directive-mode](#line-directive-mode)>** 448 449Sets how the `#line` directives should be produced. Available options are: 450 451If not specified, default behavior is to use C-style `#line` directives for HLSL and C/C++ output, and traditional GLSL-style `#line` directives for GLSL output. 452 453 454<a id="O"></a> 455### -O 456 457**-O<[optimization-level](#optimization-level)>** 458 459Set the optimization level. 460 461 462<a id="obfuscate"></a> 463### -obfuscate 464Remove all source file information from outputs. 465 466 467<a id="force-glsl-scalar-layout"></a> 468### -force-glsl-scalar-layout, -fvk-use-scalar-layout 469Make data accessed through ConstantBuffer, ParameterBlock, StructuredBuffer, ByteAddressBuffer and general pointers follow the 'scalar' layout when targeting GLSL or SPIRV. 470 471 472<a id="fvk-use-dx-layout"></a> 473### -fvk-use-dx-layout 474Pack members using FXCs member packing rules when targeting GLSL or SPIRV. 475 476 477<a id="fvk-use-c-layout"></a> 478### -fvk-use-c-layout 479Make data accessed through ConstantBuffer, ParameterBlock, StructuredBuffer, ByteAddressBuffer and general pointers follow the C/C++ structure layout rules when targeting SPIRV. 480 481 482<a id="fvk-b-shift"></a> 483### -fvk-b-shift, -fvk-s-shift, -fvk-t-shift, -fvk-u-shift 484 485**-fvk-<[vulkan-shift](#vulkan-shift)>-shift <N> <space>** 486 487For example '-fvk-b-shift <N> <space>' shifts by N the inferred binding numbers for all resources in 'b' registers of space <space>. For a resource attached with :register(bX, <space>) but not \[vk::binding(...)\], sets its Vulkan descriptor set to <space> and binding number to X + N. If you need to shift the inferred binding numbers for more than one space, provide more than one such option. If more than one such option is provided for the same space, the last one takes effect. If you need to shift the inferred binding numbers for all sets, use 'all' as <space>. 488 489* \[DXC description\](https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/SPIR-V.rst#implicit-binding-number-assignment) 490 491* \[GLSL wiki\](https://github.com/KhronosGroup/glslang/wiki/HLSL-FAQ#auto-mapped-binding-numbers) 492 493 494 495 496<a id="fvk-bind-globals"></a> 497### -fvk-bind-globals 498 499**-fvk-bind-globals <N> <descriptor-set>** 500 501Places the $Globals cbuffer at descriptor set <descriptor-set> and binding <N>. 502 503It lets you specify the descriptor for the source at a certain register. 504 505* \[DXC description\](https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/SPIR-V.rst#implicit-binding-number-assignment) 506 507 508 509 510<a id="fvk-invert-y"></a> 511### -fvk-invert-y 512Negates (additively inverts) SV_Position.y before writing to stage output. 513 514 515<a id="fvk-use-dx-position-w"></a> 516### -fvk-use-dx-position-w 517Reciprocates (multiplicatively inverts) SV_Position.w after reading from stage input. For use in fragment shaders only. 518 519 520<a id="fvk-use-entrypoint-name"></a> 521### -fvk-use-entrypoint-name 522Uses the entrypoint name from the source instead of 'main' in the spirv output. 523 524 525<a id="fvk-use-gl-layout"></a> 526### -fvk-use-gl-layout 527Use std430 layout instead of D3D buffer layout for raw buffer load/stores. 528 529 530<a id="fspv-reflect"></a> 531### -fspv-reflect 532Include reflection decorations in the resulting SPIRV for shader parameters. 533 534 535<a id="enable-effect-annotations"></a> 536### -enable-effect-annotations 537Enables support for legacy effect annotation syntax. 538 539 540<a id="emit-spirv-via-glsl"></a> 541### -emit-spirv-via-glsl 542Generate SPIR-V output by compiling generated GLSL with glslang 543 544 545<a id="emit-spirv-directly"></a> 546### -emit-spirv-directly 547Generate SPIR-V output directly (default) 548 549 550<a id="spirv-core-grammar"></a> 551### -spirv-core-grammar 552A path to a specific spirv.core.grammar.json to use when generating SPIR-V output 553 554 555<a id="incomplete-library"></a> 556### -incomplete-library 557Allow generating code from incomplete libraries with unresolved external functions 558 559 560<a id="bindless-space-index"></a> 561### -bindless-space-index 562 563**-bindless-space-index <index>** 564 565Specify the space index for the system defined global bindless resource array. 566 567 568<a id="separate-debug-info"></a> 569### -separate-debug-info 570Emit debug data to a separate file, and strip it from the main output file. 571 572 573 574<a id="Downstream"></a> 575## Downstream 576 577Downstream compiler options 578 579<a id="none-path"></a> 580### -none-path, -fxc-path, -dxc-path, -glslang-path, -spirv-dis-path, -clang-path, -visualstudio-path, -gcc-path, -genericcpp-path, -nvrtc-path, -llvm-path, -spirv-opt-path, -metal-path, -tint-path 581 582**-<[compiler](#compiler)>-path <path>** 583 584Specify path to a downstream [<compiler>](#compiler) executable or library. 585 586 587 588 589<a id="default-downstream-compiler"></a> 590### -default-downstream-compiler 591 592**-default-downstream-compiler <[language](#language)> <[compiler](#compiler)>** 593 594Set a default compiler for the given language. See [-lang](#lang) for the list of languages. 595 596 597<a id="X"></a> 598### -X 599 600**-X<[compiler](#compiler)> <option> -X<[compiler](#compiler)>... <options> -X.** 601 602Pass arguments to downstream [<compiler>](#compiler). Just [-X<compiler>](#X) passes just the next argument to the downstream compiler. [-X<compiler>](#X)... options [-X](#X). will pass *all* of the options inbetween the opening [-X](#X) and [-X](#X). to the downstream compiler. 603 604 605<a id="pass-through"></a> 606### -pass-through 607 608**-pass-through <[compiler](#compiler)>** 609 610Pass the input through mostly unmodified to the existing compiler [<compiler>](#compiler). 611 612These are intended for debugging/testing purposes, when you want to be able to see what these existing compilers do with the "same" input and options 613 614 615 616<a id="Debugging"></a> 617## Debugging 618 619Compiler debugging/instrumentation options 620 621<a id="dump-ast"></a> 622### -dump-ast 623Dump the AST to a .slang-ast file next to the input. 624 625 626<a id="dump-intermediate-prefix"></a> 627### -dump-intermediate-prefix 628 629**-dump-intermediate-prefix <prefix>** 630 631File name prefix for [-dump-intermediates](#dump-intermediates) outputs, default is no prefix 632 633 634<a id="dump-intermediates"></a> 635### -dump-intermediates 636Dump intermediate outputs for debugging. 637 638 639<a id="dump-ir"></a> 640### -dump-ir 641Dump the IR for debugging. 642 643 644<a id="dump-ir-ids"></a> 645### -dump-ir-ids 646Dump the IDs with [-dump-ir](#dump-ir) (debug builds only) 647 648 649<a id="E"></a> 650### -E, -output-preprocessor 651Output the preprocessing result and exit. 652 653 654<a id="no-codegen"></a> 655### -no-codegen 656Skip the code generation step, just check the code and generate layout. 657 658 659<a id="output-includes"></a> 660### -output-includes 661Print the hierarchy of the processed source files. 662 663 664<a id="serial-ir"></a> 665### -serial-ir 666\[REMOVED\] Serialize the IR between front-end and back-end. 667 668 669<a id="skip-codegen"></a> 670### -skip-codegen 671Skip the code generation phase. 672 673 674<a id="validate-ir"></a> 675### -validate-ir 676Validate the IR between the phases. 677 678 679<a id="verbose-paths"></a> 680### -verbose-paths 681When displaying diagnostic output aim to display more detailed path information. In practice this is typically the complete 'canonical' path to the source file used. 682 683 684<a id="verify-debug-serial-ir"></a> 685### -verify-debug-serial-ir 686Verify IR in the front-end. 687 688 689<a id="dump-module"></a> 690### -dump-module 691Disassemble and print the module IR. 692 693 694<a id="get-module-info"></a> 695### -get-module-info 696Print the name and version of a serialized IR Module 697 698 699<a id="get-supported-module-versions"></a> 700### -get-supported-module-versions 701Print the minimum and maximum module versions this compiler supports 702 703 704 705<a id="Repro"></a> 706## Repro 707 708Slang repro system related 709 710<a id="dump-repro-on-error"></a> 711### -dump-repro-on-error 712Dump `.slang-repro` file on any compilation error. 713 714 715<a id="extract-repro"></a> 716### -extract-repro 717 718**-extract-repro <name>** 719 720Extract the repro files into a folder. 721 722 723<a id="load-repro-directory"></a> 724### -load-repro-directory 725 726**-load-repro-directory <path>** 727 728Use repro along specified path 729 730 731<a id="load-repro"></a> 732### -load-repro 733 734**-load-repro <name>** 735 736Load repro 737 738 739<a id="repro-file-system"></a> 740### -repro-file-system 741 742**-repro-file-system <name>** 743 744Use a repro as a file system 745 746 747<a id="dump-repro"></a> 748### -dump-repro 749Dump a `.slang-repro` file that can be used to reproduce a compilation on another machine. 750 751 752 753 754<a id="repro-fallback-directory <path>"></a> 755### -repro-fallback-directory <path> 756 757**Specify a directory to use if a file isn't found in a repro. Should be specified *before* any repro usage such as `load-repro`. 758There are two *special* directories: 759 760* 'none:' indicates no fallback, so if the file isn't found in the repro compliation will fail 761* 'default:' is the default (which is the OS file system)** 762 763 764 765<a id="Experimental"></a> 766## Experimental 767 768Experimental options (use at your own risk) 769 770<a id="file-system"></a> 771### -file-system 772 773**-file-system <[file-system-type](#file-system-type)>** 774 775Set the filesystem hook to use for a compile request. 776 777 778<a id="heterogeneous"></a> 779### -heterogeneous 780Output heterogeneity-related code. 781 782 783<a id="no-mangle"></a> 784### -no-mangle 785Do as little mangling of names as possible. 786 787 788<a id="no-hlsl-binding"></a> 789### -no-hlsl-binding 790Do not include explicit parameter binding semantics in the output HLSL code,except for parameters that has explicit bindings in the input source. 791 792 793<a id="no-hlsl-pack-constant-buffer-elements"></a> 794### -no-hlsl-pack-constant-buffer-elements 795Do not pack elements of constant buffers into structs in the output HLSL code. 796 797 798<a id="validate-uniformity"></a> 799### -validate-uniformity 800Perform uniformity validation analysis. 801 802 803<a id="allow-glsl"></a> 804### -allow-glsl 805Enable GLSL as an input language. 806 807 808<a id="enable-experimental-passes"></a> 809### -enable-experimental-passes 810Enable experimental compiler passes 811 812 813<a id="enable-experimental-dynamic-dispatch"></a> 814### -enable-experimental-dynamic-dispatch 815Enable experimental dynamic dispatch features 816 817 818<a id="embed-downstream-ir"></a> 819### -embed-downstream-ir 820Embed downstream IR into emitted slang IR 821 822 823 824<a id="Internal"></a> 825## Internal 826 827Internal-use options (use at your own risk) 828 829<a id="archive-type-1"></a> 830### -archive-type 831 832**-archive-type <[archive-type](#archive-type)>** 833 834Set the archive type for [-save-core-module](#save-core-module). Default is zip. 835 836 837<a id="compile-core-module"></a> 838### -compile-core-module 839Compile the core module from embedded sources. Will return a failure if there is already a core module available. 840 841 842<a id="doc"></a> 843### -doc 844Write documentation for [-compile-core-module](#compile-core-module) 845 846 847<a id="ir-compression"></a> 848### -ir-compression 849 850**-ir-compression <type>** 851 852Set compression for IR and AST outputs. 853 854Accepted compression types: none, lite 855 856 857<a id="load-core-module"></a> 858### -load-core-module 859 860**-load-core-module <filename>** 861 862Load the core module from file. 863 864 865<a id="r"></a> 866### -r 867 868**-r <name>** 869 870reference module <name> 871 872 873<a id="save-core-module"></a> 874### -save-core-module 875 876**-save-core-module <filename>** 877 878Save the core module to an archive file. 879 880 881<a id="save-core-module-bin-source"></a> 882### -save-core-module-bin-source 883 884**-save-core-module-bin-source <filename>** 885 886Same as [-save-core-module](#save-core-module) but output the data as a C array. 887 888 889 890 891<a id="save-glsl-module-bin-source"></a> 892### -save-glsl-module-bin-source 893 894**-save-glsl-module-bin-source <filename>** 895 896Save the serialized glsl module as a C array. 897 898 899 900 901<a id="track-liveness"></a> 902### -track-liveness 903Enable liveness tracking. Places SLANG_LIVE_START, and SLANG_LIVE_END in output source to indicate value liveness. 904 905 906<a id="loop-inversion"></a> 907### -loop-inversion 908Enable loop inversion in the code-gen optimization. Default is off 909 910 911 912<a id="Deprecated"></a> 913## Deprecated 914 915Deprecated options (allowed but ignored; may be removed in future) 916 917<a id="parameter-blocks-use-register-spaces"></a> 918### -parameter-blocks-use-register-spaces 919Parameter blocks will use register spaces 920 921 922<a id="zero-initialize"></a> 923### -zero-initialize 924Initialize all variables to zero.Structs will set all struct-fields without an init expression to 0.All variables will call their default constructor if not explicitly initialized as usual. 925 926 927 928<a id="compiler"></a> 929## compiler 930 931Downstream Compilers (aka Pass through) 932 933* `none` : Unknown 934* `fxc` : FXC HLSL compiler 935* `dxc` : DXC HLSL compiler 936* `glslang` : GLSLANG GLSL compiler 937* `spirv-dis` : spirv-tools SPIRV disassembler 938* `clang` : Clang C/C++ compiler 939* `visualstudio`, `vs` : Visual Studio C/C++ compiler 940* `gcc` : GCC C/C++ compiler 941* `genericcpp`, `c`, `cpp` : A generic C++ compiler (can be any one of visual studio, clang or gcc depending on system and availability) 942* `nvrtc` : NVRTC CUDA compiler 943* `llvm` : LLVM/Clang `slang-llvm` 944* `spirv-opt` : spirv-tools SPIRV optimizer 945* `metal` : Metal shader compiler 946* `tint` : Tint compiler 947 948<a id="language"></a> 949## language 950 951Language 952 953* `c`, `C` : C language 954* `cpp`, `c++`, `C++`, `cxx` : C++ language 955* `slang` : Slang language 956* `glsl` : GLSL language 957* `hlsl` : HLSL language 958* `cu`, `cuda` : CUDA 959 960<a id="language-version"></a> 961## language-version 962 963Language Version 964 965* `legacy`, `default`, `2018` : Legacy Slang language 966* `2025` : Slang language rules for 2025 and older 967* `2026`, `latest` : Slang language rules for 2026 and newer 968 969<a id="archive-type"></a> 970## archive-type 971 972Archive Type 973 974* `riff-deflate` : Slang RIFF using deflate compression 975* `riff-lz4` : Slang RIFF using LZ4 compression 976* `zip` : Zip file 977* `riff` : Slang RIFF without compression 978 979<a id="line-directive-mode"></a> 980## line-directive-mode 981 982Line Directive Mode 983 984* `none` : Don't emit `#line` directives at all 985* `source-map` : Use source map to track line associations (doen't emit #line) 986* `default` : Default behavior 987* `standard` : Emit standard C-style `#line` directives. 988* `glsl` : Emit GLSL-style directives with file *number* instead of name. 989 990<a id="debug-info-format"></a> 991## debug-info-format 992 993Debug Info Format 994 995* `default-format` : Use the default debugging format for the target 996* `c7` : CodeView C7 format (typically means debugging infomation is embedded in the binary) 997* `pdb` : Program database 998* `stabs` : STABS debug format 999* `coff` : COFF debug format 1000* `dwarf` : DWARF debug format 1001 1002<a id="fp-mode"></a> 1003## fp-mode 1004 1005Floating Point Mode 1006 1007* `precise` : Disable optimization that could change the output of floating-point computations, including around infinities, NaNs, denormalized values, and negative zero. Prefer the most precise versions of special functions supported by the target. 1008* `fast` : Allow optimizations that may change results of floating-point computations. Prefer the fastest version of special functions supported by the target. 1009* `default` : Default floating point mode 1010 1011<a id="fp-denormal-mode"></a> 1012## fp-denormal-mode 1013 1014Floating Point Denormal Handling Mode 1015 1016* `any` : Use any denormal handling mode (default). The mode used is implementation defined. 1017* `preserve` : Preserve denormal values 1018* `ftz` : Flush denormals to zero 1019 1020<a id="help-style"></a> 1021## help-style 1022 1023Help Style 1024 1025* `text` : Text suitable for output to a terminal 1026* `markdown` : Markdown 1027* `no-link-markdown` : Markdown without links 1028 1029<a id="optimization-level"></a> 1030## optimization-level 1031 1032Optimization Level 1033 1034* `0`, `none` : Disable all optimizations 1035* `1`, `default` : Enable a default level of optimization.This is the default if no [-o](#o) options are used. 1036* `2`, `high` : Enable aggressive optimizations for speed. 1037* `3`, `maximal` : Enable further optimizations, which might have a significant impact on compile time, or involve unwanted tradeoffs in terms of code size. 1038 1039<a id="debug-level"></a> 1040## debug-level 1041 1042Debug Level 1043 1044* `0`, `none` : Don't emit debug information at all. 1045* `1`, `minimal` : Emit as little debug information as possible, while still supporting stack traces. 1046* `2`, `standard` : Emit whatever is the standard level of debug information for each target. 1047* `3`, `maximal` : Emit as much debug information as possible for each target. 1048 1049<a id="file-system-type"></a> 1050## file-system-type 1051 1052File System Type 1053 1054* `default` : Default file system. 1055* `load-file` : Just implements loadFile interface, so will be wrapped with CacheFileSystem internally. 1056* `os` : Use the OS based file system directly (without file system caching) 1057 1058<a id="source-embed-style"></a> 1059## source-embed-style 1060 1061Source Embed Style 1062 1063* `none` : No source level embedding 1064* `default` : The default embedding for the type to be embedded 1065* `text` : Embed as text. May change line endings. If output isn't text will use 'default'. Size will *not* contain terminating 0. 1066* `binary-text` : Embed as text assuming contents is binary. 1067* `u8` : Embed as unsigned bytes. 1068* `u16` : Embed as uint16_t. 1069* `u32` : Embed as uint32_t. 1070* `u64` : Embed as uint64_t. 1071 1072<a id="target"></a> 1073## target 1074 1075Target 1076 1077* `unknown` 1078* `none` 1079* `hlsl` : HLSL source code 1080* `dxbc` : DirectX shader bytecode binary 1081* `dxbc-asm`, `dxbc-assembly` : DirectX shader bytecode assembly 1082* `dxil` : DirectX Intermediate Language binary 1083* `dxil-asm`, `dxil-assembly` : DirectX Intermediate Language assembly 1084* `glsl` : GLSL(Vulkan) source code 1085* `spirv` : SPIR-V binary 1086* `spirv-asm`, `spirv-assembly` : SPIR-V assembly 1087* `c` : C source code 1088* `cpp`, `c++`, `cxx` : C++ source code 1089* `torch`, `torch-binding`, `torch-cpp`, `torch-cpp-binding` : C++ for pytorch binding 1090* `host-cpp`, `host-c++`, `host-cxx` : C++ source for host execution 1091* `exe`, `executable` : Executable binary 1092* `shader-sharedlib`, `shader-sharedlibrary`, `shader-dll` : Shared library/Dll for shader kernel 1093* `sharedlib`, `sharedlibrary`, `dll` : Shared library/Dll for host execution 1094* `cuda`, `cu` : CUDA source code 1095* `ptx` : PTX assembly 1096* `cuobj`, `cubin` : CUDA binary 1097* `host-callable`, `callable` : Host callable 1098* `object-code` : Object code 1099* `host-host-callable` : Host callable for host execution 1100* `metal` : Metal shader source 1101* `metallib` : Metal Library Bytecode 1102* `metallib-asm` : Metal Library Bytecode assembly 1103* `wgsl` : WebGPU shading language source 1104* `wgsl-spirv-asm`, `wgsl-spirv-assembly` : SPIR-V assembly via WebGPU shading language 1105* `wgsl-spirv` : SPIR-V via WebGPU shading language 1106* `slangvm`, `slang-vm` : Slang VM byte code 1107 1108<a id="stage"></a> 1109## stage 1110 1111Stage 1112 1113* `vertex` 1114* `hull`, `tesscontrol` 1115* `domain`, `tesseval` 1116* `geometry` 1117* `pixel`, `fragment` 1118* `compute` 1119* `raygeneration` 1120* `intersection` 1121* `anyhit` 1122* `closesthit` 1123* `miss` 1124* `callable` 1125* `mesh` 1126* `amplification`, `task` 1127* `dispatch` 1128 1129<a id="vulkan-shift"></a> 1130## vulkan-shift 1131 1132Vulkan Shift 1133 1134* `b` : Constant buffer view 1135* `s` : Sampler 1136* `t` : Shader resource view 1137* `u` : Unorderd access view 1138 1139<a id="capability"></a> 1140## capability 1141 1142A capability describes an optional feature that a target may or may not support. When a [-capability](#capability-1) is specified, the compiler may assume that the target supports that capability, and generate code accordingly. 1143 1144* `spirv_1_{ 0`, `1`, `2`, `3`, `4`, `5 }` : minimum supported SPIR - V version 1145* `textualTarget` 1146* `hlsl` 1147* `glsl` 1148* `c` 1149* `cpp` 1150* `cuda` 1151* `metal` 1152* `spirv` 1153* `wgsl` 1154* `slangvm` 1155* `glsl_spirv_1_0` 1156* `glsl_spirv_1_1` 1157* `glsl_spirv_1_2` 1158* `glsl_spirv_1_3` 1159* `glsl_spirv_1_4` 1160* `glsl_spirv_1_5` 1161* `glsl_spirv_1_6` 1162* `metallib_2_3` 1163* `metallib_2_4` 1164* `metallib_3_0` 1165* `metallib_3_1` 1166* `hlsl_nvapi` 1167* `hlsl_2018` 1168* `hlsl_coopvec_poc` 1169* `optix_coopvec` 1170* `vertex` 1171* `fragment` 1172* `compute` 1173* `hull` 1174* `domain` 1175* `geometry` 1176* `dispatch` 1177* `SPV_EXT_fragment_shader_interlock` : enables the SPV_EXT_fragment_shader_interlock extension 1178* `SPV_EXT_physical_storage_buffer` : enables the SPV_EXT_physical_storage_buffer extension 1179* `SPV_EXT_fragment_fully_covered` : enables the SPV_EXT_fragment_fully_covered extension 1180* `SPV_EXT_descriptor_indexing` : enables the SPV_EXT_descriptor_indexing extension 1181* `SPV_EXT_shader_atomic_float_add` : enables the SPV_EXT_shader_atomic_float_add extension 1182* `SPV_EXT_shader_atomic_float16_add` : enables the SPV_EXT_shader_atomic_float16_add extension 1183* `SPV_EXT_shader_atomic_float_min_max` : enables the SPV_EXT_shader_atomic_float_min_max extension 1184* `SPV_EXT_mesh_shader` : enables the SPV_EXT_mesh_shader extension 1185* `SPV_EXT_demote_to_helper_invocation` : enables the SPV_EXT_demote_to_helper_invocation extension 1186* `SPV_KHR_maximal_reconvergence` : enables the SPV_KHR_maximal_reconvergence extension 1187* `SPV_KHR_quad_control` : enables the SPV_KHR_quad_control extension 1188* `SPV_KHR_fragment_shader_barycentric` : enables the SPV_KHR_fragment_shader_barycentric extension 1189* `SPV_KHR_non_semantic_info` : enables the SPV_KHR_non_semantic_info extension 1190* `SPV_KHR_device_group` : enables the SPV_KHR_device_group extension 1191* `SPV_KHR_ray_tracing` : enables the SPV_KHR_ray_tracing extension 1192* `SPV_KHR_ray_query` : enables the SPV_KHR_ray_query extension 1193* `SPV_KHR_ray_tracing_position_fetch` : enables the SPV_KHR_ray_tracing_position_fetch extension 1194* `SPV_KHR_shader_clock` : enables the SPV_KHR_shader_clock extension 1195* `SPV_NV_shader_subgroup_partitioned` : enables the SPV_NV_shader_subgroup_partitioned extension 1196* `SPV_KHR_subgroup_rotate` : enables the SPV_KHR_subgroup_rotate extension 1197* `SPV_NV_ray_tracing_motion_blur` : enables the SPV_NV_ray_tracing_motion_blur extension 1198* `SPV_NV_shader_invocation_reorder` : enables the SPV_NV_shader_invocation_reorder extension 1199* `SPV_NV_cluster_acceleration_structure` : enables the SPV_NV_cluster_acceleration_structure extension 1200* `SPV_NV_linear_swept_spheres` : enables the SPV_NV_linear_swept_spheres extension 1201* `SPV_NV_shader_image_footprint` : enables the SPV_NV_shader_image_footprint extension 1202* `SPV_KHR_compute_shader_derivatives` : enables the SPV_KHR_compute_shader_derivatives extension 1203* `SPV_GOOGLE_user_type` : enables the SPV_GOOGLE_user_type extension 1204* `SPV_EXT_replicated_composites` : enables the SPV_EXT_replicated_composites extension 1205* `SPV_KHR_vulkan_memory_model` : enables the SPV_KHR_vulkan_memory_model extension 1206* `SPV_NV_cooperative_vector` : enables the SPV_NV_cooperative_vector extension 1207* `SPV_KHR_cooperative_matrix` : enables the SPV_KHR_cooperative_matrix extension 1208* `SPV_NV_tensor_addressing` : enables the SPV_NV_tensor_addressing extension 1209* `SPV_NV_cooperative_matrix2` : enables the SPV_NV_cooperative_matrix2 extension 1210* `SPV_NV_bindless_texture` : enables the SPV_NV_bindless_texture extension 1211* `spvDeviceGroup` 1212* `spvAtomicFloat32AddEXT` 1213* `spvAtomicFloat16AddEXT` 1214* `spvAtomicFloat64AddEXT` 1215* `spvInt64Atomics` 1216* `spvAtomicFloat32MinMaxEXT` 1217* `spvAtomicFloat16MinMaxEXT` 1218* `spvAtomicFloat64MinMaxEXT` 1219* `spvDerivativeControl` 1220* `spvImageQuery` 1221* `spvImageGatherExtended` 1222* `spvSparseResidency` 1223* `spvImageFootprintNV` 1224* `spvMinLod` 1225* `spvFragmentShaderPixelInterlockEXT` 1226* `spvFragmentBarycentricKHR` 1227* `spvFragmentFullyCoveredEXT` 1228* `spvGroupNonUniformBallot` 1229* `spvGroupNonUniformShuffle` 1230* `spvGroupNonUniformArithmetic` 1231* `spvGroupNonUniformQuad` 1232* `spvGroupNonUniformVote` 1233* `spvGroupNonUniformPartitionedNV` 1234* `spvGroupNonUniformRotateKHR` 1235* `spvRayTracingMotionBlurNV` 1236* `spvMeshShadingEXT` 1237* `spvRayTracingKHR` 1238* `spvRayTracingPositionFetchKHR` 1239* `spvRayQueryKHR` 1240* `spvRayQueryPositionFetchKHR` 1241* `spvShaderInvocationReorderNV` 1242* `spvRayTracingClusterAccelerationStructureNV` 1243* `spvRayTracingLinearSweptSpheresGeometryNV` 1244* `spvShaderClockKHR` 1245* `spvShaderNonUniformEXT` 1246* `spvShaderNonUniform` 1247* `spvDemoteToHelperInvocationEXT` 1248* `spvDemoteToHelperInvocation` 1249* `spvReplicatedCompositesEXT` 1250* `spvCooperativeVectorNV` 1251* `spvCooperativeVectorTrainingNV` 1252* `spvCooperativeMatrixKHR` 1253* `spvCooperativeMatrixReductionsNV` 1254* `spvCooperativeMatrixConversionsNV` 1255* `spvCooperativeMatrixPerElementOperationsNV` 1256* `spvCooperativeMatrixTensorAddressingNV` 1257* `spvCooperativeMatrixBlockLoadsNV` 1258* `spvTensorAddressingNV` 1259* `spvMaximalReconvergenceKHR` 1260* `spvQuadControlKHR` 1261* `spvVulkanMemoryModelKHR` 1262* `spvVulkanMemoryModelDeviceScopeKHR` 1263* `spvBindlessTextureNV` 1264* `metallib_latest` 1265* `dxil_lib` 1266* `any_target` 1267* `any_textual_target` 1268* `any_gfx_target` 1269* `any_cpp_target` 1270* `cpp_cuda` 1271* `cpp_cuda_spirv` 1272* `cpp_cuda_metal_spirv` 1273* `cuda_spirv` 1274* `cpp_cuda_glsl_spirv` 1275* `cpp_cuda_glsl_hlsl` 1276* `cpp_cuda_glsl_hlsl_spirv` 1277* `cpp_cuda_glsl_hlsl_spirv_wgsl` 1278* `cpp_cuda_glsl_hlsl_metal_spirv` 1279* `cpp_cuda_glsl_hlsl_metal_spirv_wgsl` 1280* `cpp_cuda_hlsl` 1281* `cpp_cuda_hlsl_spirv` 1282* `cpp_cuda_hlsl_metal_spirv` 1283* `cpp_glsl` 1284* `cpp_glsl_hlsl_spirv` 1285* `cpp_glsl_hlsl_spirv_wgsl` 1286* `cpp_glsl_hlsl_metal_spirv` 1287* `cpp_glsl_hlsl_metal_spirv_wgsl` 1288* `cpp_hlsl` 1289* `cuda_glsl_hlsl` 1290* `cuda_hlsl_metal_spirv` 1291* `cuda_glsl_hlsl_spirv` 1292* `cuda_glsl_hlsl_spirv_wgsl` 1293* `cuda_glsl_hlsl_metal_spirv` 1294* `cuda_glsl_hlsl_metal_spirv_wgsl` 1295* `cuda_glsl_spirv` 1296* `cuda_glsl_metal_spirv` 1297* `cuda_glsl_metal_spirv_wgsl` 1298* `cuda_hlsl` 1299* `cuda_hlsl_spirv` 1300* `glsl_hlsl_spirv` 1301* `glsl_hlsl_spirv_wgsl` 1302* `glsl_hlsl_metal_spirv` 1303* `glsl_hlsl_metal_spirv_wgsl` 1304* `glsl_metal_spirv` 1305* `glsl_metal_spirv_wgsl` 1306* `glsl_spirv` 1307* `glsl_spirv_wgsl` 1308* `hlsl_spirv` 1309* `SPV_NV_compute_shader_derivatives` : enables the SPV_NV_compute_shader_derivatives extension 1310* `GL_EXT_buffer_reference` : enables the GL_EXT_buffer_reference extension 1311* `GL_EXT_buffer_reference_uvec2` : enables the GL_EXT_buffer_reference_uvec2 extension 1312* `GL_EXT_debug_printf` : enables the GL_EXT_debug_printf extension 1313* `GL_EXT_demote_to_helper_invocation` : enables the GL_EXT_demote_to_helper_invocation extension 1314* `GL_EXT_maximal_reconvergence` : enables the GL_EXT_maximal_reconvergence extension 1315* `GL_EXT_shader_quad_control` : enables the GL_EXT_shader_quad_control extension 1316* `GL_EXT_device_group` : enables the GL_EXT_device_group extension 1317* `GL_EXT_fragment_shader_barycentric` : enables the GL_EXT_fragment_shader_barycentric extension 1318* `GL_EXT_mesh_shader` : enables the GL_EXT_mesh_shader extension 1319* `GL_EXT_nonuniform_qualifier` : enables the GL_EXT_nonuniform_qualifier extension 1320* `GL_EXT_ray_query` : enables the GL_EXT_ray_query extension 1321* `GL_EXT_ray_tracing` : enables the GL_EXT_ray_tracing extension 1322* `GL_EXT_ray_tracing_position_fetch_ray_tracing` : enables the GL_EXT_ray_tracing_position_fetch_ray_tracing extension 1323* `GL_EXT_ray_tracing_position_fetch_ray_query` : enables the GL_EXT_ray_tracing_position_fetch_ray_query extension 1324* `GL_EXT_ray_tracing_position_fetch` : enables the GL_EXT_ray_tracing_position_fetch extension 1325* `GL_EXT_samplerless_texture_functions` : enables the GL_EXT_samplerless_texture_functions extension 1326* `GL_EXT_shader_atomic_float` : enables the GL_EXT_shader_atomic_float extension 1327* `GL_EXT_shader_atomic_float_min_max` : enables the GL_EXT_shader_atomic_float_min_max extension 1328* `GL_EXT_shader_atomic_float2` : enables the GL_EXT_shader_atomic_float2 extension 1329* `GL_EXT_shader_atomic_int64` : enables the GL_EXT_shader_atomic_int64 extension 1330* `GL_EXT_shader_explicit_arithmetic_types` : enables the GL_EXT_shader_explicit_arithmetic_types extension 1331* `GL_EXT_shader_explicit_arithmetic_types_int64` : enables the GL_EXT_shader_explicit_arithmetic_types_int64 extension 1332* `GL_EXT_shader_image_load_store` : enables the GL_EXT_shader_image_load_store extension 1333* `GL_EXT_shader_realtime_clock` : enables the GL_EXT_shader_realtime_clock extension 1334* `GL_EXT_texture_query_lod` : enables the GL_EXT_texture_query_lod extension 1335* `GL_EXT_texture_shadow_lod` : enables the GL_EXT_texture_shadow_lod extension 1336* `GL_ARB_derivative_control` : enables the GL_ARB_derivative_control extension 1337* `GL_ARB_fragment_shader_interlock` : enables the GL_ARB_fragment_shader_interlock extension 1338* `GL_ARB_gpu_shader5` : enables the GL_ARB_gpu_shader5 extension 1339* `GL_ARB_shader_image_load_store` : enables the GL_ARB_shader_image_load_store extension 1340* `GL_ARB_shader_image_size` : enables the GL_ARB_shader_image_size extension 1341* `GL_ARB_texture_multisample` : enables the GL_ARB_texture_multisample extension 1342* `GL_ARB_shader_texture_image_samples` : enables the GL_ARB_shader_texture_image_samples extension 1343* `GL_ARB_sparse_texture` : enables the GL_ARB_sparse_texture extension 1344* `GL_ARB_sparse_texture2` : enables the GL_ARB_sparse_texture2 extension 1345* `GL_ARB_sparse_texture_clamp` : enables the GL_ARB_sparse_texture_clamp extension 1346* `GL_ARB_texture_gather` : enables the GL_ARB_texture_gather extension 1347* `GL_ARB_texture_query_levels` : enables the GL_ARB_texture_query_levels extension 1348* `GL_ARB_shader_clock` : enables the GL_ARB_shader_clock extension 1349* `GL_ARB_shader_clock64` : enables the GL_ARB_shader_clock64 extension 1350* `GL_ARB_gpu_shader_int64` : enables the GL_ARB_gpu_shader_int64 extension 1351* `GL_KHR_memory_scope_semantics` : enables the GL_KHR_memory_scope_semantics extension 1352* `GL_KHR_shader_subgroup_arithmetic` : enables the GL_KHR_shader_subgroup_arithmetic extension 1353* `GL_KHR_shader_subgroup_ballot` : enables the GL_KHR_shader_subgroup_ballot extension 1354* `GL_KHR_shader_subgroup_basic` : enables the GL_KHR_shader_subgroup_basic extension 1355* `GL_KHR_shader_subgroup_clustered` : enables the GL_KHR_shader_subgroup_clustered extension 1356* `GL_KHR_shader_subgroup_quad` : enables the GL_KHR_shader_subgroup_quad extension 1357* `GL_KHR_shader_subgroup_shuffle` : enables the GL_KHR_shader_subgroup_shuffle extension 1358* `GL_KHR_shader_subgroup_shuffle_relative` : enables the GL_KHR_shader_subgroup_shuffle_relative extension 1359* `GL_KHR_shader_subgroup_vote` : enables the GL_KHR_shader_subgroup_vote extension 1360* `GL_KHR_shader_subgroup_rotate` : enables the GL_KHR_shader_subgroup_rotate extension 1361* `GL_NV_compute_shader_derivatives` : enables the GL_NV_compute_shader_derivatives extension 1362* `GL_NV_fragment_shader_barycentric` : enables the GL_NV_fragment_shader_barycentric extension 1363* `GL_NV_gpu_shader5` : enables the GL_NV_gpu_shader5 extension 1364* `GL_NV_ray_tracing` : enables the GL_NV_ray_tracing extension 1365* `GL_NV_ray_tracing_motion_blur` : enables the GL_NV_ray_tracing_motion_blur extension 1366* `GL_NV_shader_atomic_fp16_vector` : enables the GL_NV_shader_atomic_fp16_vector extension 1367* `GL_NV_shader_invocation_reorder` : enables the GL_NV_shader_invocation_reorder extension 1368* `GL_NV_shader_subgroup_partitioned` : enables the GL_NV_shader_subgroup_partitioned extension 1369* `GL_NV_shader_texture_footprint` : enables the GL_NV_shader_texture_footprint extension 1370* `GL_NV_cluster_acceleration_structure` : enables the GL_NV_cluster_acceleration_structure extension 1371* `GL_NV_cooperative_vector` : enables the GL_NV_cooperative_vector extension 1372* `nvapi` 1373* `raytracing` 1374* `ser` 1375* `motionblur` 1376* `rayquery` 1377* `raytracing_motionblur` 1378* `ser_motion` 1379* `shaderclock` 1380* `fragmentshaderinterlock` 1381* `atomic64` 1382* `atomicfloat` 1383* `atomicfloat2` 1384* `fragmentshaderbarycentric` 1385* `shadermemorycontrol` 1386* `bufferreference` 1387* `bufferreference_int64` 1388* `cooperative_vector` 1389* `cooperative_vector_training` 1390* `cooperative_matrix` 1391* `cooperative_matrix_reduction` 1392* `cooperative_matrix_conversion` 1393* `cooperative_matrix_map_element` 1394* `cooperative_matrix_tensor_addressing` 1395* `cooperative_matrix_block_load` 1396* `tensor_addressing` 1397* `cooperative_matrix_2` 1398* `vk_mem_model` 1399* `pixel` 1400* `tesscontrol` 1401* `tesseval` 1402* `raygen` 1403* `raygeneration` 1404* `intersection` 1405* `anyhit` 1406* `closesthit` 1407* `callable` 1408* `miss` 1409* `mesh` 1410* `task` 1411* `amplification` 1412* `any_stage` 1413* `amplification_mesh` 1414* `raytracing_stages` 1415* `anyhit_closesthit` 1416* `raygen_closesthit_miss` 1417* `anyhit_closesthit_intersection` 1418* `anyhit_closesthit_intersection_miss` 1419* `raygen_closesthit_miss_callable` 1420* `compute_tesscontrol_tesseval` 1421* `compute_fragment` 1422* `compute_fragment_geometry_vertex` 1423* `domain_hull` 1424* `raytracingstages_fragment` 1425* `raytracingstages_compute` 1426* `raytracingstages_compute_amplification_mesh` 1427* `raytracingstages_compute_fragment` 1428* `raytracingstages_compute_fragment_geometry_vertex` 1429* `meshshading` 1430* `shadermemorycontrol_compute` 1431* `subpass` 1432* `spirv_latest` 1433* `SPIRV_1_0` 1434* `SPIRV_1_1` 1435* `SPIRV_1_2` 1436* `SPIRV_1_3` 1437* `SPIRV_1_4` 1438* `SPIRV_1_5` 1439* `SPIRV_1_6` 1440* `sm_4_0_version` 1441* `sm_4_0` 1442* `sm_4_1_version` 1443* `sm_4_1` 1444* `sm_5_0_version` 1445* `sm_5_0` 1446* `sm_5_1_version` 1447* `sm_5_1` 1448* `sm_6_0_version` 1449* `sm_6_0` 1450* `sm_6_1_version` 1451* `sm_6_1` 1452* `sm_6_2_version` 1453* `sm_6_2` 1454* `sm_6_3_version` 1455* `sm_6_3` 1456* `sm_6_4_version` 1457* `sm_6_4` 1458* `sm_6_5_version` 1459* `sm_6_5` 1460* `sm_6_6_version` 1461* `sm_6_6` 1462* `sm_6_7_version` 1463* `sm_6_7` 1464* `sm_6_8_version` 1465* `sm_6_8` 1466* `sm_6_9_version` 1467* `sm_6_9` 1468* `DX_4_0` 1469* `DX_4_1` 1470* `DX_5_0` 1471* `DX_5_1` 1472* `DX_6_0` 1473* `DX_6_1` 1474* `DX_6_2` 1475* `DX_6_3` 1476* `DX_6_4` 1477* `DX_6_5` 1478* `DX_6_6` 1479* `DX_6_7` 1480* `DX_6_8` 1481* `DX_6_9` 1482* `GLSL_130` : enables the GLSL_130 extension 1483* `GLSL_140` : enables the GLSL_140 extension 1484* `GLSL_150` : enables the GLSL_150 extension 1485* `GLSL_330` : enables the GLSL_330 extension 1486* `GLSL_400` : enables the GLSL_400 extension 1487* `GLSL_410` : enables the GLSL_410 extension 1488* `GLSL_420` : enables the GLSL_420 extension 1489* `GLSL_430` : enables the GLSL_430 extension 1490* `GLSL_440` : enables the GLSL_440 extension 1491* `GLSL_450` : enables the GLSL_450 extension 1492* `GLSL_460` : enables the GLSL_460 extension 1493* `GLSL_410_SPIRV_1_0` : enables the GLSL_410_SPIRV_1_0 extension 1494* `GLSL_420_SPIRV_1_0` : enables the GLSL_420_SPIRV_1_0 extension 1495* `GLSL_430_SPIRV_1_0` : enables the GLSL_430_SPIRV_1_0 extension 1496* `cuda_sm_1_0` 1497* `cuda_sm_2_0` 1498* `cuda_sm_3_0` 1499* `cuda_sm_3_5` 1500* `cuda_sm_4_0` 1501* `cuda_sm_5_0` 1502* `cuda_sm_6_0` 1503* `cuda_sm_7_0` 1504* `cuda_sm_8_0` 1505* `cuda_sm_9_0` 1506* `METAL_2_3` 1507* `METAL_2_4` 1508* `METAL_3_0` 1509* `METAL_3_1` 1510* `appendstructuredbuffer` 1511* `atomic_hlsl` 1512* `atomic_hlsl_nvapi` 1513* `atomic_hlsl_sm_6_6` 1514* `byteaddressbuffer` 1515* `byteaddressbuffer_rw` 1516* `consumestructuredbuffer` 1517* `structuredbuffer` 1518* `structuredbuffer_rw` 1519* `fragmentprocessing` 1520* `fragmentprocessing_derivativecontrol` 1521* `getattributeatvertex` 1522* `memorybarrier` 1523* `texture_sm_4_0` 1524* `texture_sm_4_1` 1525* `texture_sm_4_1_samplerless` 1526* `texture_sm_4_1_compute_fragment` 1527* `texture_sm_4_0_fragment` 1528* `texture_sm_4_1_clamp_fragment` 1529* `texture_sm_4_1_vertex_fragment_geometry` 1530* `texture_gather` 1531* `image_samples` 1532* `image_size` 1533* `texture_size` 1534* `texture_querylod` 1535* `texture_querylevels` 1536* `texture_shadowlod` 1537* `atomic_glsl_float1` 1538* `atomic_glsl_float2` 1539* `atomic_glsl_halfvec` 1540* `atomic_glsl` 1541* `atomic_glsl_int64` 1542* `GLSL_430_SPIRV_1_0_compute` : enables the GLSL_430_SPIRV_1_0_compute extension 1543* `image_loadstore` 1544* `nonuniformqualifier` 1545* `printf` 1546* `texturefootprint` 1547* `texturefootprintclamp` 1548* `shader5_sm_4_0` 1549* `shader5_sm_5_0` 1550* `pack_vector` 1551* `subgroup_basic` 1552* `subgroup_ballot` 1553* `subgroup_ballot_activemask` 1554* `subgroup_basic_ballot` 1555* `subgroup_vote` 1556* `shaderinvocationgroup` 1557* `subgroup_arithmetic` 1558* `subgroup_shuffle` 1559* `subgroup_shufflerelative` 1560* `subgroup_clustered` 1561* `subgroup_quad` 1562* `subgroup_partitioned` 1563* `subgroup_rotate` 1564* `atomic_glsl_hlsl_nvapi_cuda_metal_float1` 1565* `atomic_glsl_hlsl_nvapi_cuda5_int64` 1566* `atomic_glsl_hlsl_nvapi_cuda6_int64` 1567* `atomic_glsl_hlsl_nvapi_cuda9_int64` 1568* `atomic_glsl_hlsl_cuda_metal` 1569* `atomic_glsl_hlsl_cuda9_int64` 1570* `helper_lane` 1571* `quad_control` 1572* `breakpoint` 1573* `raytracing_allstages` 1574* `raytracing_anyhit` 1575* `raytracing_intersection` 1576* `raytracing_anyhit_closesthit` 1577* `raytracing_lss` 1578* `raytracing_lss_ho` 1579* `raytracing_anyhit_closesthit_intersection` 1580* `raytracing_raygen_closesthit_miss` 1581* `raytracing_anyhit_closesthit_intersection_miss` 1582* `raytracing_raygen_closesthit_miss_callable` 1583* `raytracing_position` 1584* `raytracing_motionblur_anyhit_closesthit_intersection_miss` 1585* `raytracing_motionblur_raygen_closesthit_miss` 1586* `rayquery_position` 1587* `ser_raygen` 1588* `ser_raygen_closesthit_miss` 1589* `ser_any_closesthit_intersection_miss` 1590* `ser_anyhit_closesthit_intersection` 1591* `ser_anyhit_closesthit` 1592* `ser_motion_raygen_closesthit_miss` 1593* `ser_motion_raygen` 1594* `all` 1595 1596<a id="file-extension"></a> 1597## file-extension 1598 1599A [<language>](#language), <format>, and/or [<stage>](#stage) may be inferred from the extension of an input or [-o](#o) path 1600 1601* `hlsl`, `fx` : hlsl 1602* `dxbc` 1603* `dxbc-asm` : dxbc-assembly 1604* `dxil` 1605* `dxil-asm` : dxil-assembly 1606* `glsl` 1607* `vert` : glsl (vertex) 1608* `frag` : glsl (fragment) 1609* `geom` : glsl (geoemtry) 1610* `tesc` : glsl (hull) 1611* `tese` : glsl (domain) 1612* `comp` : glsl (compute) 1613* `mesh` : glsl (mesh) 1614* `task` : glsl (amplification) 1615* `slang` 1616* `spv` : SPIR-V 1617* `spv-asm` : SPIR-V assembly 1618* `c` 1619* `cpp`, `c++`, `cxx` : C++ 1620* `exe` : executable 1621* `dll`, `so` : sharedlibrary/dll 1622* `cu` : CUDA 1623* `ptx` : PTX 1624* `obj`, `o` : object-code 1625* `zip` : container 1626* `slang-module`, `slang-library` : Slang Module/Library 1627* `dir` : Container as a directory 1628 1629<a id="help-category"></a> 1630## help-category 1631 1632Available help categories for the [-h](#h) option 1633 1634* `General` : General options 1635* `Target` : Target code generation options 1636* `Downstream` : Downstream compiler options 1637* `Debugging` : Compiler debugging/instrumentation options 1638* `Repro` : Slang repro system related 1639* `Experimental` : Experimental options (use at your own risk) 1640* `Internal` : Internal-use options (use at your own risk) 1641* `Deprecated` : Deprecated options (allowed but ignored; may be removed in future) 1642* `compiler` : Downstream Compilers (aka Pass through) 1643* `language` : Language 1644* `language-version` : Language Version 1645* `archive-type` : Archive Type 1646* `line-directive-mode` : Line Directive Mode 1647* `debug-info-format` : Debug Info Format 1648* `fp-mode` : Floating Point Mode 1649* `fp-denormal-mode` : Floating Point Denormal Handling Mode 1650* `help-style` : Help Style 1651* `optimization-level` : Optimization Level 1652* `debug-level` : Debug Level 1653* `file-system-type` : File System Type 1654* `source-embed-style` : Source Embed Style 1655* `target` : Target 1656* `stage` : Stage 1657* `vulkan-shift` : Vulkan Shift 1658* `capability` : A capability describes an optional feature that a target may or may not support. When a [-capability](#capability-1) is specified, the compiler may assume that the target supports that capability, and generate code accordingly. 1659* `file-extension` : A [<language>](#language), <format>, and/or [<stage>](#stage) may be inferred from the extension of an input or [-o](#o) path 1660* `help-category` : Available help categories for the [-h](#h) option 1661