SLANGC(1)
๐ 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- Dand<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 tomainif you specify a stage using-stage. Multiple-entryoptions 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-entryoptions 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. ๐ง-hor-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.slangsource files into a single module. ๐ฆ-o <path>โ Specify a path where generated output should be written. If no-targetor-stageis specified, one may be inferred from file extension (see<file-extension>). If multiple-targetoptions and a single-entryare present, each-oassociates with the first-targetto its left. Otherwise, if multiple-entryoptions are present, each-oassociates with the first-entryto its left, and with the-targetthat 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-stageinformation:{vs,hs,ds,gs,ps}_<version>See-capabilityfor information on<capability>. When multiple-targetoptions are present, each-profileassociates with the first-targetto 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-entryoptions are present, each-stageassociated with the first-entryto its left. May be omitted if entry-point function has a[shader(...)]attribute; otherwise required for each-entryoption. 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 ofgit 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 allor-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 thannone), will write compile results into embeddable source for the target language. If no output file is specified, the output is written tostdout. 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++ withu16/u32/u64types 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 means2.<debug-info-format>specifies a debugging info format. It is valid to have multiple-goptions, 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#linedirectives should be produced. Available options are: If not specified, default behavior is to use C-style#linedirectives for HLSL and C/C++ output, and traditional GLSL-style#linedirectives 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 throughConstantBuffer,ParameterBlock,StructuredBuffer,ByteAddressBufferand 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 throughConstantBuffer,ParameterBlock,StructuredBuffer,ByteAddressBufferand
general pointers follow the C/C++ structure layout rules when targeting SPIRV. โจ
-fvk-<vulkan-shift>-shift <N> <space>โ bestie this one shifts your inferred binding numbers around. Like, for example-fvk-b-shift <N> <space>shifts byNthe inferred binding numbers for all resources in'b'registers of space<space>. For a resource attached with:register(bX, <space>)but not[vk::binding(...)], it sets its Vulkan descriptor set to<space>and binding number toX + N. Need to shift the inferred binding numbers for more than one space? Just pass more than one of these bad boys. Pass more than one for the same space and the last one wins. And if you wanna shift the inferred binding numbers for all the sets, use'all'as<space>๐ซถ
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$Globalscbuffer 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.ybefore writing to stage output. Flipping it, literally ๐-fvk-use-dx-position-wโ reciprocates (multiplicatively inverts)SV_Position.wafter 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โ usestd430layout 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 specificspirv.core.grammar.jsonto 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-langfor 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-Xand-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-astfile next to the input.-dump-intermediate-prefix <prefix>โ file name prefix for-dump-intermediatesoutputs, 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 to0. 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
- ubuntu resolute: slang-compiler 2026.1.1+ds-0ubuntu1 ยท Apache-2.0 OR CC-BY-4.0 OR Apache-2.0 WITH LLVM exception OR MIT OR NCSA
- ubuntu stonking: slang-compiler 2026.1.1+ds-0ubuntu1 ยท Apache-2.0 OR CC-BY-4.0 OR Apache-2.0 WITH LLVM exception OR MIT OR NCSA
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms