yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Lujin WangAdd SPV_NV_bindless_texture support (#8534)99de1a620

master
49.0 KiB1661 linesraw

Slang Command Line Options

Usage:

slangc [options...] [--] <input files>

# For help
slangc -h

# To generate this file
slangc -help-style markdown -h

Quick Links

<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

-O<optimization-level>

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 : Unknown
  • fxc : FXC HLSL compiler
  • dxc : DXC HLSL compiler
  • glslang : GLSLANG GLSL compiler
  • spirv-dis : spirv-tools SPIRV disassembler
  • clang : Clang C/C++ compiler
  • visualstudio, vs : Visual Studio C/C++ compiler
  • gcc : GCC C/C++ compiler
  • genericcpp, c, cpp : A generic C++ compiler (can be any one of visual studio, clang or gcc depending on system and availability)
  • nvrtc : NVRTC CUDA compiler
  • llvm : LLVM/Clang slang-llvm
  • spirv-opt : spirv-tools SPIRV optimizer
  • metal : Metal shader compiler
  • tint : Tint compiler

<a id="language"></a>

language

Language

  • c, C : C language
  • cpp, c++, C++, cxx : C++ language
  • slang : Slang language
  • glsl : GLSL language
  • hlsl : HLSL language
  • cu, cuda : CUDA

<a id="language-version"></a>

language-version

Language Version

  • legacy, default, 2018 : Legacy Slang language
  • 2025 : Slang language rules for 2025 and older
  • 2026, latest : Slang language rules for 2026 and newer

<a id="archive-type"></a>

archive-type

Archive Type

  • riff-deflate : Slang RIFF using deflate compression
  • riff-lz4 : Slang RIFF using LZ4 compression
  • zip : Zip file
  • riff : Slang RIFF without compression

<a id="line-directive-mode"></a>

line-directive-mode

Line Directive Mode

  • none : Don't emit #line directives at all
  • source-map : Use source map to track line associations (doen't emit #line)
  • default : Default behavior
  • standard : Emit standard C-style #line directives.
  • 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 target
  • c7 : CodeView C7 format (typically means debugging infomation is embedded in the binary)
  • pdb : Program database
  • stabs : STABS debug format
  • coff : COFF debug format
  • dwarf : 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 values
  • ftz : Flush denormals to zero

<a id="help-style"></a>

help-style

Help Style

  • text : Text suitable for output to a terminal
  • markdown : Markdown
  • no-link-markdown : Markdown without links

<a id="optimization-level"></a>

optimization-level

Optimization Level

  • 0, none : Disable all optimizations
  • 1, 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 embedding
  • default : The default embedding for the type to be embedded
  • text : 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

  • unknown
  • none
  • hlsl : HLSL source code
  • dxbc : DirectX shader bytecode binary
  • dxbc-asm, dxbc-assembly : DirectX shader bytecode assembly
  • dxil : DirectX Intermediate Language binary
  • dxil-asm, dxil-assembly : DirectX Intermediate Language assembly
  • glsl : GLSL(Vulkan) source code
  • spirv : SPIR-V binary
  • spirv-asm, spirv-assembly : SPIR-V assembly
  • c : C source code
  • cpp, c++, cxx : C++ source code
  • torch, torch-binding, torch-cpp, torch-cpp-binding : C++ for pytorch binding
  • host-cpp, host-c++, host-cxx : C++ source for host execution
  • exe, executable : Executable binary
  • shader-sharedlib, shader-sharedlibrary, shader-dll : Shared library/Dll for shader kernel
  • sharedlib, sharedlibrary, dll : Shared library/Dll for host execution
  • cuda, cu : CUDA source code
  • ptx : PTX assembly
  • cuobj, cubin : CUDA binary
  • host-callable, callable : Host callable
  • object-code : Object code
  • host-host-callable : Host callable for host execution
  • metal : Metal shader source
  • metallib : Metal Library Bytecode
  • metallib-asm : Metal Library Bytecode assembly
  • wgsl : WebGPU shading language source
  • wgsl-spirv-asm, wgsl-spirv-assembly : SPIR-V assembly via WebGPU shading language
  • wgsl-spirv : SPIR-V via WebGPU shading language
  • slangvm, slang-vm : Slang VM byte code

<a id="stage"></a>

stage

Stage

  • vertex
  • hull, tesscontrol
  • domain, tesseval
  • geometry
  • pixel, fragment
  • compute
  • raygeneration
  • intersection
  • anyhit
  • closesthit
  • miss
  • callable
  • mesh
  • amplification, task
  • dispatch

<a id="vulkan-shift"></a>

vulkan-shift

Vulkan Shift

  • b : Constant buffer view
  • s : Sampler
  • t : Shader resource view
  • u : 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 version
  • textualTarget
  • hlsl
  • glsl
  • c
  • cpp
  • cuda
  • metal
  • spirv
  • wgsl
  • slangvm
  • glsl_spirv_1_0
  • glsl_spirv_1_1
  • glsl_spirv_1_2
  • glsl_spirv_1_3
  • glsl_spirv_1_4
  • glsl_spirv_1_5
  • glsl_spirv_1_6
  • metallib_2_3
  • metallib_2_4
  • metallib_3_0
  • metallib_3_1
  • hlsl_nvapi
  • hlsl_2018
  • hlsl_coopvec_poc
  • optix_coopvec
  • vertex
  • fragment
  • compute
  • hull
  • domain
  • geometry
  • dispatch
  • SPV_EXT_fragment_shader_interlock : enables the SPV_EXT_fragment_shader_interlock extension
  • SPV_EXT_physical_storage_buffer : enables the SPV_EXT_physical_storage_buffer extension
  • SPV_EXT_fragment_fully_covered : enables the SPV_EXT_fragment_fully_covered extension
  • SPV_EXT_descriptor_indexing : enables the SPV_EXT_descriptor_indexing extension
  • SPV_EXT_shader_atomic_float_add : enables the SPV_EXT_shader_atomic_float_add extension
  • SPV_EXT_shader_atomic_float16_add : enables the SPV_EXT_shader_atomic_float16_add extension
  • SPV_EXT_shader_atomic_float_min_max : enables the SPV_EXT_shader_atomic_float_min_max extension
  • SPV_EXT_mesh_shader : enables the SPV_EXT_mesh_shader extension
  • SPV_EXT_demote_to_helper_invocation : enables the SPV_EXT_demote_to_helper_invocation extension
  • SPV_KHR_maximal_reconvergence : enables the SPV_KHR_maximal_reconvergence extension
  • SPV_KHR_quad_control : enables the SPV_KHR_quad_control extension
  • SPV_KHR_fragment_shader_barycentric : enables the SPV_KHR_fragment_shader_barycentric extension
  • SPV_KHR_non_semantic_info : enables the SPV_KHR_non_semantic_info extension
  • SPV_KHR_device_group : enables the SPV_KHR_device_group extension
  • SPV_KHR_ray_tracing : enables the SPV_KHR_ray_tracing extension
  • SPV_KHR_ray_query : enables the SPV_KHR_ray_query extension
  • SPV_KHR_ray_tracing_position_fetch : enables the SPV_KHR_ray_tracing_position_fetch extension
  • SPV_KHR_shader_clock : enables the SPV_KHR_shader_clock extension
  • SPV_NV_shader_subgroup_partitioned : enables the SPV_NV_shader_subgroup_partitioned extension
  • SPV_KHR_subgroup_rotate : enables the SPV_KHR_subgroup_rotate extension
  • SPV_NV_ray_tracing_motion_blur : enables the SPV_NV_ray_tracing_motion_blur extension
  • SPV_NV_shader_invocation_reorder : enables the SPV_NV_shader_invocation_reorder extension
  • SPV_NV_cluster_acceleration_structure : enables the SPV_NV_cluster_acceleration_structure extension
  • SPV_NV_linear_swept_spheres : enables the SPV_NV_linear_swept_spheres extension
  • SPV_NV_shader_image_footprint : enables the SPV_NV_shader_image_footprint extension
  • SPV_KHR_compute_shader_derivatives : enables the SPV_KHR_compute_shader_derivatives extension
  • SPV_GOOGLE_user_type : enables the SPV_GOOGLE_user_type extension
  • SPV_EXT_replicated_composites : enables the SPV_EXT_replicated_composites extension
  • SPV_KHR_vulkan_memory_model : enables the SPV_KHR_vulkan_memory_model extension
  • SPV_NV_cooperative_vector : enables the SPV_NV_cooperative_vector extension
  • SPV_KHR_cooperative_matrix : enables the SPV_KHR_cooperative_matrix extension
  • SPV_NV_tensor_addressing : enables the SPV_NV_tensor_addressing extension
  • SPV_NV_cooperative_matrix2 : enables the SPV_NV_cooperative_matrix2 extension
  • SPV_NV_bindless_texture : enables the SPV_NV_bindless_texture extension
  • spvDeviceGroup
  • spvAtomicFloat32AddEXT
  • spvAtomicFloat16AddEXT
  • spvAtomicFloat64AddEXT
  • spvInt64Atomics
  • spvAtomicFloat32MinMaxEXT
  • spvAtomicFloat16MinMaxEXT
  • spvAtomicFloat64MinMaxEXT
  • spvDerivativeControl
  • spvImageQuery
  • spvImageGatherExtended
  • spvSparseResidency
  • spvImageFootprintNV
  • spvMinLod
  • spvFragmentShaderPixelInterlockEXT
  • spvFragmentBarycentricKHR
  • spvFragmentFullyCoveredEXT
  • spvGroupNonUniformBallot
  • spvGroupNonUniformShuffle
  • spvGroupNonUniformArithmetic
  • spvGroupNonUniformQuad
  • spvGroupNonUniformVote
  • spvGroupNonUniformPartitionedNV
  • spvGroupNonUniformRotateKHR
  • spvRayTracingMotionBlurNV
  • spvMeshShadingEXT
  • spvRayTracingKHR
  • spvRayTracingPositionFetchKHR
  • spvRayQueryKHR
  • spvRayQueryPositionFetchKHR
  • spvShaderInvocationReorderNV
  • spvRayTracingClusterAccelerationStructureNV
  • spvRayTracingLinearSweptSpheresGeometryNV
  • spvShaderClockKHR
  • spvShaderNonUniformEXT
  • spvShaderNonUniform
  • spvDemoteToHelperInvocationEXT
  • spvDemoteToHelperInvocation
  • spvReplicatedCompositesEXT
  • spvCooperativeVectorNV
  • spvCooperativeVectorTrainingNV
  • spvCooperativeMatrixKHR
  • spvCooperativeMatrixReductionsNV
  • spvCooperativeMatrixConversionsNV
  • spvCooperativeMatrixPerElementOperationsNV
  • spvCooperativeMatrixTensorAddressingNV
  • spvCooperativeMatrixBlockLoadsNV
  • spvTensorAddressingNV
  • spvMaximalReconvergenceKHR
  • spvQuadControlKHR
  • spvVulkanMemoryModelKHR
  • spvVulkanMemoryModelDeviceScopeKHR
  • spvBindlessTextureNV
  • metallib_latest
  • dxil_lib
  • any_target
  • any_textual_target
  • any_gfx_target
  • any_cpp_target
  • cpp_cuda
  • cpp_cuda_spirv
  • cpp_cuda_metal_spirv
  • cuda_spirv
  • cpp_cuda_glsl_spirv
  • cpp_cuda_glsl_hlsl
  • cpp_cuda_glsl_hlsl_spirv
  • cpp_cuda_glsl_hlsl_spirv_wgsl
  • cpp_cuda_glsl_hlsl_metal_spirv
  • cpp_cuda_glsl_hlsl_metal_spirv_wgsl
  • cpp_cuda_hlsl
  • cpp_cuda_hlsl_spirv
  • cpp_cuda_hlsl_metal_spirv
  • cpp_glsl
  • cpp_glsl_hlsl_spirv
  • cpp_glsl_hlsl_spirv_wgsl
  • cpp_glsl_hlsl_metal_spirv
  • cpp_glsl_hlsl_metal_spirv_wgsl
  • cpp_hlsl
  • cuda_glsl_hlsl
  • cuda_hlsl_metal_spirv
  • cuda_glsl_hlsl_spirv
  • cuda_glsl_hlsl_spirv_wgsl
  • cuda_glsl_hlsl_metal_spirv
  • cuda_glsl_hlsl_metal_spirv_wgsl
  • cuda_glsl_spirv
  • cuda_glsl_metal_spirv
  • cuda_glsl_metal_spirv_wgsl
  • cuda_hlsl
  • cuda_hlsl_spirv
  • glsl_hlsl_spirv
  • glsl_hlsl_spirv_wgsl
  • glsl_hlsl_metal_spirv
  • glsl_hlsl_metal_spirv_wgsl
  • glsl_metal_spirv
  • glsl_metal_spirv_wgsl
  • glsl_spirv
  • glsl_spirv_wgsl
  • hlsl_spirv
  • SPV_NV_compute_shader_derivatives : enables the SPV_NV_compute_shader_derivatives extension
  • GL_EXT_buffer_reference : enables the GL_EXT_buffer_reference extension
  • GL_EXT_buffer_reference_uvec2 : enables the GL_EXT_buffer_reference_uvec2 extension
  • GL_EXT_debug_printf : enables the GL_EXT_debug_printf extension
  • GL_EXT_demote_to_helper_invocation : enables the GL_EXT_demote_to_helper_invocation extension
  • GL_EXT_maximal_reconvergence : enables the GL_EXT_maximal_reconvergence extension
  • GL_EXT_shader_quad_control : enables the GL_EXT_shader_quad_control extension
  • GL_EXT_device_group : enables the GL_EXT_device_group extension
  • GL_EXT_fragment_shader_barycentric : enables the GL_EXT_fragment_shader_barycentric extension
  • GL_EXT_mesh_shader : enables the GL_EXT_mesh_shader extension
  • GL_EXT_nonuniform_qualifier : enables the GL_EXT_nonuniform_qualifier extension
  • GL_EXT_ray_query : enables the GL_EXT_ray_query extension
  • GL_EXT_ray_tracing : enables the GL_EXT_ray_tracing extension
  • GL_EXT_ray_tracing_position_fetch_ray_tracing : enables the GL_EXT_ray_tracing_position_fetch_ray_tracing extension
  • GL_EXT_ray_tracing_position_fetch_ray_query : enables the GL_EXT_ray_tracing_position_fetch_ray_query extension
  • GL_EXT_ray_tracing_position_fetch : enables the GL_EXT_ray_tracing_position_fetch extension
  • GL_EXT_samplerless_texture_functions : enables the GL_EXT_samplerless_texture_functions extension
  • GL_EXT_shader_atomic_float : enables the GL_EXT_shader_atomic_float extension
  • GL_EXT_shader_atomic_float_min_max : enables the GL_EXT_shader_atomic_float_min_max extension
  • GL_EXT_shader_atomic_float2 : enables the GL_EXT_shader_atomic_float2 extension
  • GL_EXT_shader_atomic_int64 : enables the GL_EXT_shader_atomic_int64 extension
  • GL_EXT_shader_explicit_arithmetic_types : enables the GL_EXT_shader_explicit_arithmetic_types extension
  • GL_EXT_shader_explicit_arithmetic_types_int64 : enables the GL_EXT_shader_explicit_arithmetic_types_int64 extension
  • GL_EXT_shader_image_load_store : enables the GL_EXT_shader_image_load_store extension
  • GL_EXT_shader_realtime_clock : enables the GL_EXT_shader_realtime_clock extension
  • GL_EXT_texture_query_lod : enables the GL_EXT_texture_query_lod extension
  • GL_EXT_texture_shadow_lod : enables the GL_EXT_texture_shadow_lod extension
  • GL_ARB_derivative_control : enables the GL_ARB_derivative_control extension
  • GL_ARB_fragment_shader_interlock : enables the GL_ARB_fragment_shader_interlock extension
  • GL_ARB_gpu_shader5 : enables the GL_ARB_gpu_shader5 extension
  • GL_ARB_shader_image_load_store : enables the GL_ARB_shader_image_load_store extension
  • GL_ARB_shader_image_size : enables the GL_ARB_shader_image_size extension
  • GL_ARB_texture_multisample : enables the GL_ARB_texture_multisample extension
  • GL_ARB_shader_texture_image_samples : enables the GL_ARB_shader_texture_image_samples extension
  • GL_ARB_sparse_texture : enables the GL_ARB_sparse_texture extension
  • GL_ARB_sparse_texture2 : enables the GL_ARB_sparse_texture2 extension
  • GL_ARB_sparse_texture_clamp : enables the GL_ARB_sparse_texture_clamp extension
  • GL_ARB_texture_gather : enables the GL_ARB_texture_gather extension
  • GL_ARB_texture_query_levels : enables the GL_ARB_texture_query_levels extension
  • GL_ARB_shader_clock : enables the GL_ARB_shader_clock extension
  • GL_ARB_shader_clock64 : enables the GL_ARB_shader_clock64 extension
  • GL_ARB_gpu_shader_int64 : enables the GL_ARB_gpu_shader_int64 extension
  • GL_KHR_memory_scope_semantics : enables the GL_KHR_memory_scope_semantics extension
  • GL_KHR_shader_subgroup_arithmetic : enables the GL_KHR_shader_subgroup_arithmetic extension
  • GL_KHR_shader_subgroup_ballot : enables the GL_KHR_shader_subgroup_ballot extension
  • GL_KHR_shader_subgroup_basic : enables the GL_KHR_shader_subgroup_basic extension
  • GL_KHR_shader_subgroup_clustered : enables the GL_KHR_shader_subgroup_clustered extension
  • GL_KHR_shader_subgroup_quad : enables the GL_KHR_shader_subgroup_quad extension
  • GL_KHR_shader_subgroup_shuffle : enables the GL_KHR_shader_subgroup_shuffle extension
  • GL_KHR_shader_subgroup_shuffle_relative : enables the GL_KHR_shader_subgroup_shuffle_relative extension
  • GL_KHR_shader_subgroup_vote : enables the GL_KHR_shader_subgroup_vote extension
  • GL_KHR_shader_subgroup_rotate : enables the GL_KHR_shader_subgroup_rotate extension
  • GL_NV_compute_shader_derivatives : enables the GL_NV_compute_shader_derivatives extension
  • GL_NV_fragment_shader_barycentric : enables the GL_NV_fragment_shader_barycentric extension
  • GL_NV_gpu_shader5 : enables the GL_NV_gpu_shader5 extension
  • GL_NV_ray_tracing : enables the GL_NV_ray_tracing extension
  • GL_NV_ray_tracing_motion_blur : enables the GL_NV_ray_tracing_motion_blur extension
  • GL_NV_shader_atomic_fp16_vector : enables the GL_NV_shader_atomic_fp16_vector extension
  • GL_NV_shader_invocation_reorder : enables the GL_NV_shader_invocation_reorder extension
  • GL_NV_shader_subgroup_partitioned : enables the GL_NV_shader_subgroup_partitioned extension
  • GL_NV_shader_texture_footprint : enables the GL_NV_shader_texture_footprint extension
  • GL_NV_cluster_acceleration_structure : enables the GL_NV_cluster_acceleration_structure extension
  • GL_NV_cooperative_vector : enables the GL_NV_cooperative_vector extension
  • nvapi
  • raytracing
  • ser
  • motionblur
  • rayquery
  • raytracing_motionblur
  • ser_motion
  • shaderclock
  • fragmentshaderinterlock
  • atomic64
  • atomicfloat
  • atomicfloat2
  • fragmentshaderbarycentric
  • shadermemorycontrol
  • bufferreference
  • bufferreference_int64
  • cooperative_vector
  • cooperative_vector_training
  • cooperative_matrix
  • cooperative_matrix_reduction
  • cooperative_matrix_conversion
  • cooperative_matrix_map_element
  • cooperative_matrix_tensor_addressing
  • cooperative_matrix_block_load
  • tensor_addressing
  • cooperative_matrix_2
  • vk_mem_model
  • pixel
  • tesscontrol
  • tesseval
  • raygen
  • raygeneration
  • intersection
  • anyhit
  • closesthit
  • callable
  • miss
  • mesh
  • task
  • amplification
  • any_stage
  • amplification_mesh
  • raytracing_stages
  • anyhit_closesthit
  • raygen_closesthit_miss
  • anyhit_closesthit_intersection
  • anyhit_closesthit_intersection_miss
  • raygen_closesthit_miss_callable
  • compute_tesscontrol_tesseval
  • compute_fragment
  • compute_fragment_geometry_vertex
  • domain_hull
  • raytracingstages_fragment
  • raytracingstages_compute
  • raytracingstages_compute_amplification_mesh
  • raytracingstages_compute_fragment
  • raytracingstages_compute_fragment_geometry_vertex
  • meshshading
  • shadermemorycontrol_compute
  • subpass
  • spirv_latest
  • SPIRV_1_0
  • SPIRV_1_1
  • SPIRV_1_2
  • SPIRV_1_3
  • SPIRV_1_4
  • SPIRV_1_5
  • SPIRV_1_6
  • sm_4_0_version
  • sm_4_0
  • sm_4_1_version
  • sm_4_1
  • sm_5_0_version
  • sm_5_0
  • sm_5_1_version
  • sm_5_1
  • sm_6_0_version
  • sm_6_0
  • sm_6_1_version
  • sm_6_1
  • sm_6_2_version
  • sm_6_2
  • sm_6_3_version
  • sm_6_3
  • sm_6_4_version
  • sm_6_4
  • sm_6_5_version
  • sm_6_5
  • sm_6_6_version
  • sm_6_6
  • sm_6_7_version
  • sm_6_7
  • sm_6_8_version
  • sm_6_8
  • sm_6_9_version
  • sm_6_9
  • DX_4_0
  • DX_4_1
  • DX_5_0
  • DX_5_1
  • DX_6_0
  • DX_6_1
  • DX_6_2
  • DX_6_3
  • DX_6_4
  • DX_6_5
  • DX_6_6
  • DX_6_7
  • DX_6_8
  • DX_6_9
  • GLSL_130 : enables the GLSL_130 extension
  • GLSL_140 : enables the GLSL_140 extension
  • GLSL_150 : enables the GLSL_150 extension
  • GLSL_330 : enables the GLSL_330 extension
  • GLSL_400 : enables the GLSL_400 extension
  • GLSL_410 : enables the GLSL_410 extension
  • GLSL_420 : enables the GLSL_420 extension
  • GLSL_430 : enables the GLSL_430 extension
  • GLSL_440 : enables the GLSL_440 extension
  • GLSL_450 : enables the GLSL_450 extension
  • GLSL_460 : enables the GLSL_460 extension
  • GLSL_410_SPIRV_1_0 : enables the GLSL_410_SPIRV_1_0 extension
  • GLSL_420_SPIRV_1_0 : enables the GLSL_420_SPIRV_1_0 extension
  • GLSL_430_SPIRV_1_0 : enables the GLSL_430_SPIRV_1_0 extension
  • cuda_sm_1_0
  • cuda_sm_2_0
  • cuda_sm_3_0
  • cuda_sm_3_5
  • cuda_sm_4_0
  • cuda_sm_5_0
  • cuda_sm_6_0
  • cuda_sm_7_0
  • cuda_sm_8_0
  • cuda_sm_9_0
  • METAL_2_3
  • METAL_2_4
  • METAL_3_0
  • METAL_3_1
  • appendstructuredbuffer
  • atomic_hlsl
  • atomic_hlsl_nvapi
  • atomic_hlsl_sm_6_6
  • byteaddressbuffer
  • byteaddressbuffer_rw
  • consumestructuredbuffer
  • structuredbuffer
  • structuredbuffer_rw
  • fragmentprocessing
  • fragmentprocessing_derivativecontrol
  • getattributeatvertex
  • memorybarrier
  • texture_sm_4_0
  • texture_sm_4_1
  • texture_sm_4_1_samplerless
  • texture_sm_4_1_compute_fragment
  • texture_sm_4_0_fragment
  • texture_sm_4_1_clamp_fragment
  • texture_sm_4_1_vertex_fragment_geometry
  • texture_gather
  • image_samples
  • image_size
  • texture_size
  • texture_querylod
  • texture_querylevels
  • texture_shadowlod
  • atomic_glsl_float1
  • atomic_glsl_float2
  • atomic_glsl_halfvec
  • atomic_glsl
  • atomic_glsl_int64
  • GLSL_430_SPIRV_1_0_compute : enables the GLSL_430_SPIRV_1_0_compute extension
  • image_loadstore
  • nonuniformqualifier
  • printf
  • texturefootprint
  • texturefootprintclamp
  • shader5_sm_4_0
  • shader5_sm_5_0
  • pack_vector
  • subgroup_basic
  • subgroup_ballot
  • subgroup_ballot_activemask
  • subgroup_basic_ballot
  • subgroup_vote
  • shaderinvocationgroup
  • subgroup_arithmetic
  • subgroup_shuffle
  • subgroup_shufflerelative
  • subgroup_clustered
  • subgroup_quad
  • subgroup_partitioned
  • subgroup_rotate
  • atomic_glsl_hlsl_nvapi_cuda_metal_float1
  • atomic_glsl_hlsl_nvapi_cuda5_int64
  • atomic_glsl_hlsl_nvapi_cuda6_int64
  • atomic_glsl_hlsl_nvapi_cuda9_int64
  • atomic_glsl_hlsl_cuda_metal
  • atomic_glsl_hlsl_cuda9_int64
  • helper_lane
  • quad_control
  • breakpoint
  • raytracing_allstages
  • raytracing_anyhit
  • raytracing_intersection
  • raytracing_anyhit_closesthit
  • raytracing_lss
  • raytracing_lss_ho
  • raytracing_anyhit_closesthit_intersection
  • raytracing_raygen_closesthit_miss
  • raytracing_anyhit_closesthit_intersection_miss
  • raytracing_raygen_closesthit_miss_callable
  • raytracing_position
  • raytracing_motionblur_anyhit_closesthit_intersection_miss
  • raytracing_motionblur_raygen_closesthit_miss
  • rayquery_position
  • ser_raygen
  • ser_raygen_closesthit_miss
  • ser_any_closesthit_intersection_miss
  • ser_anyhit_closesthit_intersection
  • ser_anyhit_closesthit
  • ser_motion_raygen_closesthit_miss
  • ser_motion_raygen
  • all

<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 : hlsl
  • dxbc
  • dxbc-asm : dxbc-assembly
  • dxil
  • dxil-asm : dxil-assembly
  • glsl
  • vert : glsl (vertex)
  • frag : glsl (fragment)
  • geom : glsl (geoemtry)
  • tesc : glsl (hull)
  • tese : glsl (domain)
  • comp : glsl (compute)
  • mesh : glsl (mesh)
  • task : glsl (amplification)
  • slang
  • spv : SPIR-V
  • spv-asm : SPIR-V assembly
  • c
  • cpp, c++, cxx : C++
  • exe : executable
  • dll, so : sharedlibrary/dll
  • cu : CUDA
  • ptx : PTX
  • obj, o : object-code
  • zip : container
  • slang-module, slang-library : Slang Module/Library
  • dir : Container as a directory

<a id="help-category"></a>

help-category

Available help categories for the -h option

  • General : General options
  • Target : Target code generation options
  • Downstream : Downstream compiler options
  • Debugging : Compiler debugging/instrumentation options
  • Repro : Slang repro system related
  • Experimental : 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 : Language
  • language-version : Language Version
  • archive-type : Archive Type
  • line-directive-mode : Line Directive Mode
  • debug-info-format : Debug Info Format
  • fp-mode : Floating Point Mode
  • fp-denormal-mode : Floating Point Denormal Handling Mode
  • help-style : Help Style
  • optimization-level : Optimization Level
  • debug-level : Debug Level
  • file-system-type : File System Type
  • source-embed-style : Source Embed Style
  • target : Target
  • stage : Stage
  • vulkan-shift : Vulkan Shift
  • 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.
  • file-extension : A <language>, <format>, and/or <stage> may be inferred from the extension of an input or -o path
  • help-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&lt;name&gt;\[=&lt;value&gt;\], -D &lt;name&gt;\[=&lt;value&gt;\]**
52
53Insert a preprocessor macro. 
54
55The space between - D and &lt;name&gt; is optional. If no &lt;value&gt; is specified, Slang will define the macro with an empty value. 
56
57
58<a id="depfile"></a>
59### -depfile
60
61**-depfile &lt;path&gt;**
62
63Save the source file dependency list in a file. 
64
65
66<a id="entry"></a>
67### -entry
68
69**-entry &lt;name&gt;**
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 &lt;typename&gt;**
84
85Specialize the last entrypoint with &lt;typename&gt;. 
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 &lt;[help-category](#help-category)&gt;**
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 &lt;[help-style](#help-style)&gt;**
107
108Help formatting style 
109
110
111<a id="I"></a>
112### -I
113
114**-I&lt;path&gt;, -I &lt;path&gt;**
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 &lt;[language](#language)&gt;**
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 &lt;name&gt;**
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 &lt;path&gt;**
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 [&lt;file-extension&gt;](#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 &lt;path&gt;. 
178
179
180<a id="profile"></a>
181### -profile
182
183**-profile &lt;profile&gt;\[+&lt;[capability](#capability)&gt;...\]**
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}_&lt;version&gt; 
196
197See [-capability](#capability-1) for information on [&lt;capability&gt;](#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 &lt;[stage](#stage)&gt;**
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 &lt;[target](#target)&gt;**
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 &lt;[language-version](#language-version)&gt;**
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 &lt;id&gt;\[,&lt;id&gt;...\]**
241
242all - Treat all warnings as errors. 
243
244&lt;id&gt;\[,&lt;id&gt;...\]: Treat specific warning ids as errors. 
245
246
247
248
249<a id="warnings-disable"></a>
250### -warnings-disable
251
252**-warnings-disable &lt;id&gt;\[,&lt;id&gt;...\]**
253
254Disable specific warning ids. 
255
256
257<a id="W"></a>
258### -W
259
260**-W&lt;id&gt;**
261
262Enable a warning with the specified id. 
263
264
265<a id="Wno"></a>
266### -Wno-
267
268**-Wno-&lt;id&gt;**
269
270Disable warning with &lt;id&gt; 
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 &lt;[source-embed-style](#source-embed-style)&gt;**
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 &lt;stdint.h&gt;" before the generated file. 
313
314
315
316
317<a id="source-embed-name"></a>
318### -source-embed-name
319
320**-source-embed-name &lt;name&gt;**
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 &lt;[language](#language)&gt;**
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 "&amp;&amp;" 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 &lt;typeName&gt;:&lt;interfaceName&gt;\[=&lt;sequentialID&gt;\]**
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 &lt;path&gt;**
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 &lt;[capability](#capability)&gt;\[+&lt;[capability](#capability)&gt;...\]**
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 &lt;[fp-mode](#fp-mode)&gt;, -floating-point-mode &lt;[fp-mode](#fp-mode)&gt;**
402
403Control floating point optimizations 
404
405
406<a id="denorm-mode-fp16"></a>
407### -denorm-mode-fp16
408
409**-denorm-mode-fp16 &lt;[fp-denormal-mode](#fp-denormal-mode)&gt;**
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 &lt;[fp-denormal-mode](#fp-denormal-mode)&gt;**
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 &lt;[fp-denormal-mode](#fp-denormal-mode)&gt;**
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&lt;[debug-info-format](#debug-info-format)&gt;, -g&lt;[debug-level](#debug-level)&gt;**
434
435Include debug information in the generated code, where possible. 
436
437[&lt;debug-level&gt;](#debug-level) is the amount of information, 0..3, unspecified means 2 
438
439[&lt;debug-info-format&gt;](#debug-info-format) specifies a debugging info format 
440
441It is valid to have multiple [-g](#g) options, such as a [&lt;debug-level&gt;](#debug-level) and a [&lt;debug-info-format&gt;](#debug-info-format) 
442
443
444<a id="line-directive-mode-1"></a>
445### -line-directive-mode
446
447**-line-directive-mode &lt;[line-directive-mode](#line-directive-mode)&gt;**
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&lt;[optimization-level](#optimization-level)&gt;**
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-&lt;[vulkan-shift](#vulkan-shift)&gt;-shift &lt;N&gt; &lt;space&gt;**
486
487For example '-fvk-b-shift &lt;N&gt; &lt;space&gt;' shifts by N the inferred binding numbers for all resources in 'b' registers of space &lt;space&gt;. For a resource attached with :register(bX, &lt;space&gt;) but not \[vk::binding(...)\], sets its Vulkan descriptor set to &lt;space&gt; 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 &lt;space&gt;. 
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 &lt;N&gt; &lt;descriptor-set&gt;**
500
501Places the $Globals cbuffer at descriptor set &lt;descriptor-set&gt; and binding &lt;N&gt;. 
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 &lt;index&gt;**
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**-&lt;[compiler](#compiler)&gt;-path &lt;path&gt;**
583
584Specify path to a downstream [&lt;compiler&gt;](#compiler) executable or library. 
585
586
587
588
589<a id="default-downstream-compiler"></a>
590### -default-downstream-compiler
591
592**-default-downstream-compiler &lt;[language](#language)&gt; &lt;[compiler](#compiler)&gt;**
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&lt;[compiler](#compiler)&gt; &lt;option&gt; -X&lt;[compiler](#compiler)&gt;... &lt;options&gt; -X.**
601
602Pass arguments to downstream [&lt;compiler&gt;](#compiler). Just [-X&lt;compiler&gt;](#X) passes just the next argument to the downstream compiler. [-X&lt;compiler&gt;](#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 &lt;[compiler](#compiler)&gt;**
609
610Pass the input through mostly unmodified to the existing compiler [&lt;compiler&gt;](#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 &lt;prefix&gt;**
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 &lt;name&gt;**
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 &lt;path&gt;**
727
728Use repro along specified path 
729
730
731<a id="load-repro"></a>
732### -load-repro
733
734**-load-repro &lt;name&gt;**
735
736Load repro 
737
738
739<a id="repro-file-system"></a>
740### -repro-file-system
741
742**-repro-file-system &lt;name&gt;**
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 &lt;[file-system-type](#file-system-type)&gt;**
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 &lt;[archive-type](#archive-type)&gt;**
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 &lt;type&gt;**
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 &lt;filename&gt;**
861
862Load the core module from file. 
863
864
865<a id="r"></a>
866### -r
867
868**-r &lt;name&gt;**
869
870reference module &lt;name&gt; 
871
872
873<a id="save-core-module"></a>
874### -save-core-module
875
876**-save-core-module &lt;filename&gt;**
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 &lt;filename&gt;**
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 &lt;filename&gt;**
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 [&lt;language&gt;](#language), &lt;format&gt;, and/or [&lt;stage&gt;](#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 [&lt;language&gt;](#language), &lt;format&gt;, and/or [&lt;stage&gt;](#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