SLANGC(1)

๐Ÿ“ฆ version 2026.1.1, in ubuntu resolute, ubuntu stonking

๐Ÿ’– SLANGC(1) โ€” User Commands ๐Ÿ’–

okay bestie, welcome to the SLANGC(1) manual page for slangc, the Slang Compiler. It's giving compiler-core, main-character energy, and we're gonna read every single detail together. No skips. No cap. โœจ

๐ŸŒธ NAME ๐ŸŒธ

slangc โ€” Slang Compiler ๐Ÿ’…

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

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

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

okay so this page is split into General and Target zones, and every option is literally right here. Buckle up, bestie. ๐Ÿซถ

๐Ÿ’– General ======= ๐Ÿ’–

โœจ General options โœจ

  • -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. ๐ŸŽ€
  • -depfile <path> โ€” Save the source file dependency list in a file. ๐Ÿ’พ
  • -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. ๐Ÿ‘‘
  • -specialize <typename> โ€” Specialize the last entrypoint with <typename>. โœจ
  • -emit-ir โ€” Emit IR typically as a '.slang-module' when outputting to a container. ๐Ÿงš
  • -h or -h <help-category> โ€” Print this message, or help in specified category. To get a list of values that can be used for <help-category>, use "slangc -h help-category". ๐Ÿ“š
  • -help-style <help-style> โ€” Help formatting style. To get a list of values that can be used for <help-style>, use "slangc -h help-style". ๐ŸŽ€
  • -I<path>, -I <path> โ€” Add a path to be used in resolving '#include' and 'import' operations. ๐Ÿ”
  • -lang <language> โ€” Set the language for the following input files. To get a list of values that can be used for <language>, use "slangc -h language". ๐ŸŒ
  • -matrix-layout-column-major โ€” Set the default matrix layout to column-major. ๐ŸงŠ
  • -matrix-layout-row-major โ€” Set the default matrix layout to row-major. ๐Ÿ”ฅ
  • -restrictive-capability-check โ€” Many capability warnings will become an error. ๐Ÿ’€
  • -ignore-capabilities โ€” Do not warn or error if capabilities are violated. ๐Ÿ™ˆ
  • -minimum-slang-optimization โ€” Perform minimum code optimization in Slang to favor compilation time. โฑ๏ธ
  • -disable-non-essential-validations โ€” Disable non-essential IR validations such as use of uninitialized variables. ๐Ÿšซ
  • -disable-source-map โ€” Disable source mapping in the Obfuscation. ๐Ÿ•ถ๏ธ
  • -module-name <name> โ€” Set the module name to use when compiling multiple .slang source files into a single module. ๐Ÿ“ฆ
  • -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>. ๐Ÿ’พ
  • -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. To get a list of values that can be used for <capability>, use "slangc -h capability". ๐ŸŒˆ
  • -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. To get a list of values that can be used for <stage>, use "slangc -h stage". ๐ŸŽญ
  • -target <target> โ€” Specifies the format in which code should be generated. To get a list of values that can be used for <target>, use "slangc -h target". ๐ŸŽฏ
  • -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'. ๐Ÿ”ข
  • -std <language-version> โ€” Specifies the language standard that should be used. To get a list of values that can be used for <language-version>, use "slangc -h language-version". ๐Ÿ“˜
  • -warnings-as-errors all or -warnings-as-errors <id>[,<id>...] โ€” all - Treat all warnings as errors. <id>[,<id>...]: Treat specific warning ids as errors. โš ๏ธ
  • -warnings-disable <id>[,<id>...] โ€” Disable specific warning ids. ๐Ÿ”‡
  • -W<id> โ€” Enable a warning with the specified id. ๐Ÿ”Š
  • -Wno-<id> โ€” Disable warning with <id>. ๐Ÿ”•
  • -dump-warning-diagnostics โ€” Dump to output list of warning diagnostic numeric and name ids. ๐Ÿ“
  • -- โ€” Treat the rest of the command line as input files. ๐Ÿ›‘
  • -report-downstream-time โ€” Reports the time spent in the downstream compiler. โณ
  • -report-perf-benchmark โ€” Reports compiler performance benchmark results. ๐Ÿ“Š
  • -report-detailed-perf-benchmark โ€” Reports compiler performance benchmark results for each intermediate pass (implies -report-perf-benchmark). ๐Ÿ”ฌ
  • -report-checkpoint-intermediates โ€” Reports information about checkpoint contexts used for reverse-mode automatic differentiation. โ™ป๏ธ
  • -report-dynamic-dispatch-sites โ€” Reports information about dynamic dispatch sites for interface calls. ๐Ÿ“ก
  • -skip-spirv-validation โ€” Skips spirv validation. ๐Ÿšง
  • -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. To get a list of values that can be used for <source-embed-style>, use "slangc -h source-embed-style". ๐Ÿช„
  • -source-embed-name <name> โ€” The name used as the basis for variables output for source embedding. ๐Ÿท๏ธ
  • -source-embed-language <language> โ€” The language to be used for source embedding. Defaults to C/C++. Currently only C/C++ are supported To get a list of values that can be used for <language>, use "slangc -h language". ๐ŸŒ
  • -disable-short-circuit โ€” Disable short-circuiting for "&&" and "||" operations. โšก
  • -unscoped-enum โ€” Treat enums types as unscoped by default. ๐Ÿ”“
  • -preserve-params โ€” Preserve all resource parameters in the output code, even if they are not used by the shader. ๐Ÿ›ก๏ธ
  • -conformance <typeName>:<interfaceName>[=<sequentialID>] โ€” Include additional type conformance during linking for dynamic dispatch. ๐Ÿงฉ
  • -reflection-json <path> โ€” Emit reflection data in JSON format to a file. ๐Ÿ“„
  • -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). ๐Ÿงฑ

๐Ÿ’– Target ====== ๐Ÿ’–

โœจ Target code generation options โœจ

  • -capability <capability>[+<capability>...] โ€” Add optional capabilities to a code generation target. See Capabilities below. To get a list of values that can be used for <capability>, use "slangc -h capability". ๐ŸŽ›๏ธ
  • -default-image-format-unknown โ€” Set the format of R/W images with unspecified format to 'unknown'. Otherwise try to guess the format. ๐Ÿ–ผ๏ธ
  • -disable-dynamic-dispatch โ€” Disables generating dynamic dispatch code. ๐Ÿšซ
  • -disable-specialization โ€” Disables generics and specialization pass. ๐Ÿงฌ
  • -fp-mode <fp-mode>, -floating-point-mode <fp-mode> โ€” Control floating point optimizations. To get a list of values that can be used for <fp-mode>, use "slangc -h fp-mode". ๐ŸŽˆ
  • -denorm-mode-fp16 <fp-denormal-mode> โ€” Control handling of 16-bit denormal floating point values in SPIR-V (any, preserve, ftz). To get a list of values that can be used for <fp-denormal-mode>, use "slangc -h fp-denormal-mode". ๐ŸงŠ
  • -denorm-mode-fp32 <fp-denormal-mode> โ€” Control handling of 32-bit denormal floating point values in SPIR-V and DXIL (any, preserve, ftz). To get a list of values that can be used for <fp-denormal-mode>, use "slangc -h fp-denormal-mode". ๐Ÿ”ฅ
  • -denorm-mode-fp64 <fp-denormal-mode> โ€” Control handling of 64-bit denormal floating point values in SPIR-V (any, preserve, ftz). To get a list of values that can be used for <fp-denormal-mode>, use "slangc -h fp-denormal-mode". ๐Ÿ’Ž
  • -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>. To get a list of values that can be used for <debug-info-format>, use "slangc -h debug-info-format". To get a list of values that can be used for <debug-level>, use "slangc -h debug-level". ๐Ÿž
  • -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. To get a list of values that can be used for <line-directive-mode>, use "slangc -h line-directive-mode". ๐Ÿ“
  • -O<optimization-level> โ€” Set the optimization level. To get a list of values that can be used for <optimization-level>, use "slangc -h optimization-level". โš™๏ธ
  • -obfuscate โ€” Remove all source file information from outputs. ๐Ÿ•ต๏ธ
  • -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. ๐Ÿงฎ
  • -fvk-use-dx-layout โ€” Pack members using FXCs member packing rules when targeting GLSL or SPIRV. ๐Ÿ“ฆ
  • -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. โœจ

To get a list of values that can be used for <vulkan-shift>, use "slangc -h vulkan-shift" ๐Ÿ’…

  • -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. ๐ŸŽ€
  • -fvk-invert-y โ€” negates (additively inverts) SV_Position.y before writing to stage output. Flipping it, literally ๐Ÿ™ˆ
  • -fvk-use-dx-position-w โ€” reciprocates (multiplicatively inverts) SV_Position.w after reading from stage input. For use in fragment shaders only, no cap.
  • -fvk-use-entrypoint-name โ€” uses the entrypoint name from the source instead of 'main' in the spirv output. Name it like you mean it ๐Ÿ’–
  • -fvk-use-gl-layout โ€” use std430 layout instead of D3D buffer layout for raw buffer load/stores.
  • -fspv-reflect โ€” include reflection decorations in the resulting SPIRV for shader parameters.
  • -enable-effect-annotations โ€” enables support for legacy effect annotation syntax.
  • -emit-spirv-via-glsl โ€” generate SPIR-V output by compiling generated GLSL with glslang.
  • -emit-spirv-directly โ€” generate SPIR-V output directly (default).
  • -spirv-core-grammar โ€” a path to a specific spirv.core.grammar.json to use when generating SPIR-V output.
  • -incomplete-library โ€” allow generating code from incomplete libraries with unresolved external functions.
  • -bindless-space-index <index> โ€” specify the space index for the system defined global bindless resource array.
  • -separate-debug-info โ€” emit debug data to a separate file, and strip it from the main output file. Clean girl output โœจ
  • -emit-cpu-via-cpp โ€” generate CPU targets using C++ (default).
  • -emit-cpu-via-llvm โ€” generate CPU targets using LLVM.
  • -llvm-target-triple <target triple> โ€” sets the target triple for the LLVM target, enabling cross compilation. The default value is the host platform.
  • -llvm-cpu <cpu name> โ€” sets the target CPU for the LLVM target, enabling the extensions and features of that CPU. The default value is "generic".
  • -llvm-features <a1,+enable,-disable,...> โ€” sets a comma-separates list of architecture-specific features for the LLVM targets.

๐Ÿฆ‹ Downstream ๐Ÿฆ‹

Downstream compiler options

  • -<compiler>-path <path> โ€” specify path to a downstream <compiler> executable or library. To get a list of values that can be used for <compiler>, use "slangc -h compiler" ๐Ÿ‘‘
  • -default-downstream-compiler <language> <compiler> โ€” set a default compiler for the given language. See -lang for the list of languages. To get a list of values that can be used for <language>, use "slangc -h language". To get a list of values that can be used for <compiler>, use "slangc -h compiler".
  • -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. To get a list of values that can be used for <compiler>, use "slangc -h compiler" ๐Ÿ’ซ
  • -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. To get a list of values that can be used for <compiler>, use "slangc -h compiler" ๐Ÿ”

๐Ÿ’€ Debugging ๐Ÿ’€

Compiler debugging/instrumentation options

  • -dump-ast โ€” dump the AST to a .slang-ast file next to the input.
  • -dump-intermediate-prefix <prefix> โ€” file name prefix for -dump-intermediates outputs, default is no prefix.
  • -dump-intermediates โ€” dump intermediate outputs for debugging.
  • -dump-ir โ€” dump the IR after every pass for debugging.
  • -dump-ir-ids โ€” dump the IDs with -dump-ir (debug builds only).
  • -E, -output-preprocessor โ€” output the preprocessing result and exit.
  • -no-codegen โ€” skip the code generation step, just check the code and generate layout.
  • -output-includes โ€” print the hierarchy of the processed source files.
  • -serial-ir โ€” [REMOVED] serialize the IR between front-end and back-end. Girl, she's gone ๐Ÿ˜ญ
  • -skip-codegen โ€” skip the code generation phase.
  • -validate-ir โ€” validate the IR after select intermediate passes.
  • -validate-ir-detailed โ€” perform debug validation on IR after each intermediate pass.
  • -dump-ir-before <pass-names> โ€” dump IR before specified pass, may be specified more than once.
  • -dump-ir-after <pass-names> โ€” dump IR after specified pass, may be specified more than once.
  • -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. ๐Ÿ›ฃ๏ธ
  • -verify-debug-serial-ir โ€” verify IR in the front-end.
  • -dump-module โ€” disassemble and print the module IR.
  • -get-module-info โ€” print the name and version of a serialized IR Module.
  • -get-supported-module-versions โ€” print the minimum and maximum module versions this compiler supports.

๐Ÿงš Experimental ๐Ÿงš

Experimental options (use at your own risk)

bestie. at your own risk. I said what I said ๐Ÿ’…
  • -file-system <file-system-type> โ€” set the filesystem hook to use for a compile request. To get a list of values that can be used for <file-system-type>, use "slangc -h file-system-type".
  • -heterogeneous โ€” output heterogeneity-related code.
  • -no-mangle โ€” do as little mangling of names as possible.
  • -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.
  • -no-hlsl-pack-constant-buffer-elements โ€” do not pack elements of constant buffers into structs in the output HLSL code.
  • -validate-uniformity โ€” perform uniformity validation analysis.
  • -allow-glsl โ€” enable GLSL as an input language.
  • -enable-experimental-passes โ€” enable experimental compiler passes.
  • -enable-experimental-dynamic-dispatch โ€” enable experimental dynamic dispatch features.
  • -embed-downstream-ir โ€” embed downstream IR into emitted slang IR.
  • -experimental-feature โ€” enable experimental features (loading builtin neural module).
  • -enable-experimental-rich-diagnostics โ€” enable experimental rich diagnostics with enhanced formatting and details.

๐ŸŽ€ Deprecated ๐ŸŽ€

Deprecated options (allowed but ignored; may be removed in future)

ngl these are just vibing in the corner being ignored. They still get accepted, but they might get yeeted in a future release, so don't build your whole personality on them ๐Ÿ™ˆ
  • -parameter-blocks-use-register-spaces โ€” parameter blocks will use register spaces.
  • -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.

๐ŸŒˆ Getting Help for Specific Categories ๐ŸŒˆ

To get help for a specific category of options or values, use: slangc -h <help-category>

<help-category> can be: General, Target, Downstream, Debugging, Repro, Experimental, Internal, Deprecated, compiler, language, language-version, archive-type, line-directive-mode, debug-info-format, fp-mode, fp-denormal-mode, help-style, optimization-level, debug-level, file-system-type, source-embed-style, target, stage, vulkan-shift, capability, file-extension, help-category


๐ŸŒธ SEE ALSO ๐ŸŒธ

The full documentation for slangc is maintained as a Texinfo manual. If the info and slangc programs are properly installed at your site, the command

info slangc

should give you access to the complete manual. Go read it, it's giving main character energy ๐Ÿ‘‘


and that's a wrap on slangc bestie ๐Ÿ’– this page is from slangc 2026.1, dated March 2026, and you can find it hanging out in section SLANGC(1) of the manual. periodt ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from