OS Manuals

/usr/bin/glslangValidator

Collection of tools, libraries, and tests for Vulkan shader compilation

From shaderc 2026.4-r0 (os), captured 2026-11-05 by running glslangValidator --help (exit 1). permalink

Usage: glslang [option]... [file]...

'file' with one of the following three endings can be auto-classified:
1) .<stage>, where <stage> is one of:
    vert    for a vertex shader
    tesc    for a tessellation control shader
    tese    for a tessellation evaluation shader
    geom    for a geometry shader
    frag    for a fragment shader
    comp    for a compute shader
    mesh    for a mesh shader
    task    for a task shader
    rgen    for a ray generation shader
    rint    for a ray intersection shader
    rahit   for a ray any hit shader
    rchit   for a ray closest hit shader
    rmiss   for a ray miss shader
    rcall   for a ray callable shader
2) .<stage>.glsl or .<stage>.hlsl compound suffix, where stage options are
   described above
3) .conf, to provide a config file that replaces the default configuration (see
   -c option below for generating a template)

Options:
  -C          cascading errors; risk crash from accumulation of error recoveries
  -D          input is HLSL (this is the default when any suffix is .hlsl)
  -D<name[=def]> | --D <name[=def]> | --define-macro <name[=def]>
              define a pre-processor macro
  -E          print pre-processed GLSL; cannot be used with -l; errors will
              appear on stderr
  -G[ver]     create SPIR-V binary under OpenGL semantics; turns on -l; default
              file name is <stage>.spv (-o overrides this); ver, when present,
              is the version of the input semantics which will appear in
              '#define GL_SPIRV ver'; --client opengl100 is the same as -G100; a
              --target-env for OpenGL will also imply -G; currently only
              supports GLSL
  -H          print human readable form of SPIR-V; turns on -V
  -I<dir>     add <dir> to the include search path; includer's directory is
              searched first, followed by left-to-right order of -I
  -O          optimizes SPIR-V for performance
  -Os         optimizes SPIR-V to minimize size
  -Od         disables optimization; may cause illegal SPIR-V for HLSL
  -P<text> | --P <text> | --preamble-text <text>
              inject custom preamble text which is treated as if it appeared
              immediately after the version declaration (if any)
  -R          use relaxed verification rules for generating Vulkan SPIR-V,
              allowing the use of default uniforms, atomic_uints, and the
              gl_VertexID and gl_InstanceID keywords
  -S <stage>  uses the specified <stage> rather than parsing the file extension;
              choices for <stage> include vert, tesc, tese, geom, frag, and
              comp; a full list of options is given above
  -U<name> | --undef-macro <name> | --U <name>
              undefine a pre-processor macro
  -V[ver]     create SPIR-V binary under Vulkan semantics; turns on -l; default
              file name is <stage>.spv (-o overrides this); ver, when present,
              is the version of the input semantics which will appear in
              '#define VULKAN ver'; --client vulkan100 is the same as -V100; a
              '--target-env' for Vulkan will also imply '-V'
  -c          configuration dump; creates the default configuration file
              (redirect to a .conf file)
  -d          default to desktop (#version 110) when there is no shader #version
              (default is ES version 100)
  -e <name> | --entry-point <name>
              specify <name> as the entry-point function name
  -f{hlsl_functionality1}
              'hlsl_functionality1' enables use of the
              SPV_GOOGLE_hlsl_functionality1 extension
  -g          generate debug information
  -g0         strip debug information
  -gV         generate nonsemantic shader debug information
  -gVS        generate nonsemantic shader debug information with source
  -h | --help print this usage message
  -i          intermediate tree (glslang AST) is printed out
  -l          link all input files together to form a single module
  -m          memory leak mode
  -o <file>   save binary to <file>; requires a binary option (e.g., -V)
  -q          dump reflection query database; requires -l for linking
  -r | --relaxed-errors
              relaxed GLSL semantic error-checking mode
  -s          silence syntax and semantic error reporting
  -t          multi-threaded mode
  -u<name>:<loc>
              specify a uniform location override for --aml
  -v | --version
              print version strings
  -w | --suppress-warnings
              suppress GLSL warnings, except as required by '#extension : warn'
  -x          save binary output as text-based 32-bit hexadecimal numbers
  --absolute-path                   prints absolute path for messages
  --relax-set-binding-limits        allow larger layout(set) and
                                    layout(binding) values
  --auto-map-binding | --auto-map-bindings | --amb
                                    automatically bind uniform variables without
                                    explicit bindings
  --auto-map-locations | --aml      automatically locate input/output lacking
                                    'location' (fragile, not cross stage)
  --auto-sampled-textures           removes sampler variables and converts
                                    existing textures to sampled textures
  --client {vulkan<ver> | opengl<ver>}
                                    see -V and -G
  --depfile <file>                  writes depfile for build systems
  --discard-is-terminate            map GLSL discard to OpTerminateInvocation
                                    instead of OpDemoteToHelperInvocation
  --dump-builtin-symbols            prints builtin symbol table prior each
                                    compile
  -dumpfullversion | -dumpversion   print bare major.minor.patchlevel
  --enhanced-msgs                   print more readable error messages (GLSL
                                    only)
  --error-column                    display the column of the error along the
                                    line
  --flatten-uniform-array | --flatten-uniform-arrays | --fua
                                    flatten uniform texture/sampler arrays to
                                    scalars
  --glsl-version {100 | 110 | 120 | 130 | 140 | 150 |
                  300es | 310es | 320es | 330 |
                  400 | 410 | 420 | 430 | 440 | 450 | 460}
                                    set GLSL version; overrides #version in
                                    shader source
  --hlsl-dx-position-w              W component of SV_Position in HLSL fragment
                                    shaders compatible with DirectX
  --hlsl-dx9-compatible             interprets sampler declarations as a
                                    texture/sampler combo like DirectX9 would,
                                    and recognizes DirectX9-specific semantics
  --hlsl-enable-16bit-types         allow 16-bit types in SPIR-V for HLSL
  --hlsl-iomap | --hlsl-iomapper | --hlsl-iomapping
                                    perform IO mapping in HLSL register space
  --hlsl-offsets                    allow block offsets to follow HLSL rules;
                                    works independently of source language
  --invert-y | --iy                 invert position.Y output in vertex shader
  --keep-uncalled | --ku            don't eliminate uncalled functions
  --lto                             perform link time optimization
  --nan-clamp                       favor non-NaN operand in min, max, and clamp
  --no-link                         only compile shader; do not link (GLSL only)
                                    NOTE: this option will set the export
                                          linkage attribute on all functions
  --no-storage-format | --nsf       use Unknown image format
  --quiet                           do not print anything to stdout unless
                                    requested by another option
  --reflect-all-block-variables     reflect all variables in blocks, whether
                                    inactive or active
  --reflect-basic-array-suffix      arrays of basic types will have trailing [0]
  --reflect-intermediate-io         reflection includes inputs/outputs of linked
                                    shaders rather than just vertex/fragment
  --reflect-separate-buffers        reflect buffer variables and blocks
                                    separately to uniforms
  --reflect-strict-array-suffix     use strict array suffix rules when
                                    reflecting
  --reflect-unwrap-io-blocks        unwrap input/output blocks the same as
                                    uniform blocks
  --resource-set-binding <stage> [name] <set> [binding]...
                                    set descriptor set and binding for
                                    individual resources
  --resource-set-binding [stage] <set>
                                    set descriptor set for all resources
  --resource-set-bindings | --rsb   synonyms for --resource-set-binding
  --set-atomic-counter-block <name> <set>
                                    set name and descriptor set for atomic
                                    counter blocks with -R opt
  --sacb                            synonym for set-atomic-counter-block
  --set-block-backing name {uniform | buffer | push_constant}
                                    changes the backing type of a uniform,
                                    buffer, or push_constant block declared in
                                    the program when using the -R option; this
                                    can be used to change the backing for
                                    existing blocks as well as implicit ones
                                    such as 'gl_DefaultUniformBlock'
  --set-default-uniform-block <name> <set> <binding>
                                    set name, descriptor set, and binding for
                                    global default-uniform-block with -R opt
  --sdub                            synonym for set-default-uniform-block
  --shift-image-binding [stage] <num>
                                    base binding number for images (UAV)
  --shift-image-binding [stage] <num> <set>...
                                    per-descriptor-set shift values
  --shift-image-bindings | --sib    synonyms for --shift-image-binding
  --shift-sampler-binding [stage] <num>
                                    base binding number for samplers
  --shift-sampler-binding [stage] <num> <set>...
                                    per-descriptor-set shift values
  --shift-sampler-bindings | --ssb  synonyms for --shift-sampler-binding
  --shift-ssbo-binding [stage] <num>
                                    base binding number for SSBOs
  --shift-ssbo-binding [stage] <num> <set>...
                                    per-descriptor-set shift values
  --shift-ssbo-bindings | --sbb     synonyms for --shift-ssbo-binding
  --shift-texture-binding [stage] <num>
                                    base binding number for textures
  --shift-texture-binding [stage] <num> <set>...
                                    per-descriptor-set shift values
  --shift-texture-bindings | --stb  synonyms for --shift-texture-binding
  --shift-uav-binding [stage] <num> base binding number for UAVs
  --shift-uav-binding [stage] <num> <set>...
                                    per-descriptor-set shift values
  --shift-uav-bindings | --suavb    synonyms for --shift-uav-binding
  --shift-ubo-binding [stage] <num> base binding number for UBOs
  --shift-ubo-binding [stage] <num> <set>...
                                    per-descriptor-set shift values
  --shift-ubo-bindings | --sub |
  --shift-cbuffer-binding | --shift-cbuffer-bindings | --scb
                                    synonyms for --shift-ubo-binding
  --shift-combined-sampler-binding [stage] <num>
                                    base binding number for combined samplers
  --shift-combined-sampler-binding [stage] <num> <set>...
                                    per-descriptor-set shift values
  --shift-combined-sampler-bindings | --scsb
                                    synonyms for --shift-combined-sampler-binding
  --shift-as-binding [stage] <num>
                                    base binding number for acceleration structures
  --shift-as-binding [stage] <num> <set>...
                                    per-descriptor-set shift values
  --shift-as-bindings | --sab
                                    synonyms for --shift-as-binding
  --spirv-dis                       output standard-form disassembly; works only
                                    when a SPIR-V generation option is also used
  --spirv-val                       execute the SPIRV-Tools validator
  --source-entrypoint <name> | --sep <name>
                                    the given shader source function is renamed
                                    to be the <name> given in -e
  --stdin                           read from stdin instead of from a file;
                                    requires providing the shader stage using -S
  --target-env {vulkan1.0 | vulkan1.1 | vulkan1.2 | vulkan1.3 | vulkan1.4 |
                opengl | spirv1.0 | spirv1.1 | spirv1.2 | spirv1.3 |
                spirv1.4 | spirv1.5 | spirv1.6}
                                    set the execution environment the generated
                                    code will be executed in; defaults to:
                                     * vulkan1.0 under --client vulkan<ver>
                                     * opengl    under --client opengl<ver>
                                     * spirv1.0  under --target-env vulkan1.0
                                     * spirv1.3  under --target-env vulkan1.1
                                     * spirv1.5  under --target-env vulkan1.2
                                     * spirv1.6  under --target-env vulkan1.3
                                     * spirv1.6  under --target-env vulkan1.4
                                    multiple --target-env can be specified
  --uniform-base <base>             set a base to use for generated uniform
                                    locations
  --variable-name <name> | --vn <name>
                                    creates a C header file that contains a
                                    uint32_t array named <name> initialized with
                                    the shader binary code
  --validate-io                     validate cross stage IO
  --bindings-per-resource-type
Options (68)
OptionDescriptionSource
-Ccascading errors;help
-Dinput is HLSL (this is the default when any suffix is .hlsl)help
-Eprint pre-processed GLSL;help
-G vercreate SPIR-V binary under OpenGL semantics;help
-Hprint human readable form of SPIR-V;help
-I diradd <dir> to the include search path;help
-Ooptimizes SPIR-V for performancehelp
-Osoptimizes SPIR-V to minimize sizehelp
-Oddisables optimization;help
-Ruse relaxed verification rules for generating Vulkan SPIR-V, allowing the use of default uniforms, atomic_uints, and the gl_VertexID and gl_InstanceID keywordshelp
-S stageuses the specified <stage> rather than parsing the file extension;help
-V vercreate SPIR-V binary under Vulkan semantics;help
-cconfiguration dump;help
-ddefault to desktop (#version 110) when there is no shader #version (default is ES version 100)help
-ggenerate debug informationhelp
-g0strip debug informationhelp
-gVgenerate nonsemantic shader debug informationhelp
-gVSgenerate nonsemantic shader debug information with sourcehelp
-iintermediate tree (glslang AST) is printed outhelp
-llink all input files together to form a single modulehelp
-mmemory leak modehelp
-o filesave binary to <file>;help
-qdump reflection query database;help
-ssilence syntax and semantic error reportinghelp
-tmulti-threaded modehelp
-u name>:<locspecify a uniform location override for --amlhelp
-xsave binary output as text-based 32-bit hexadecimal numbershelp
--absolute-pathprints absolute path for messageshelp
--relax-set-binding-limitsallow larger layout(set) and layout(binding) valueshelp
--auto-map-locations, --amlautomatically locate input/output lacking 'location' (fragile, not cross stage)help
--auto-sampled-texturesremoves sampler variables and converts existing textures to sampled textureshelp
--depfile filewrites depfile for build systemshelp
--discard-is-terminatemap GLSL discard to OpTerminateInvocation instead of OpDemoteToHelperInvocationhelp
--dump-builtin-symbolsprints builtin symbol table prior each compilehelp
-dumpfullversion, -dumpversionprint bare major.minor.patchlevelhelp
--enhanced-msgsprint more readable error messages (GLSL only)help
--error-columndisplay the column of the error along the linehelp
--hlsl-dx-position-wW component of SV_Position in HLSL fragment shaders compatible with DirectXhelp
--hlsl-dx9-compatibleinterprets sampler declarations as a texture/sampler combo like DirectX9 would, and recognizes DirectX9-specific semanticshelp
--hlsl-enable-16bit-typesallow 16-bit types in SPIR-V for HLSLhelp
--hlsl-offsetsallow block offsets to follow HLSL rules;help
--invert-y, --iyinvert position.Y output in vertex shaderhelp
--keep-uncalled, --kudon't eliminate uncalled functionshelp
--ltoperform link time optimizationhelp
--nan-clampfavor non-NaN operand in min, max, and clamphelp
--no-linkonly compile shader;help
--no-storage-format, --nsfuse Unknown image formathelp
--quietdo not print anything to stdout unless requested by another optionhelp
--reflect-all-block-variablesreflect all variables in blocks, whether inactive or activehelp
--reflect-basic-array-suffixarrays of basic types will have trailing [0]help
--reflect-intermediate-ioreflection includes inputs/outputs of linked shaders rather than just vertex/fragmenthelp
--reflect-separate-buffersreflect buffer variables and blocks separately to uniformshelp
--reflect-strict-array-suffixuse strict array suffix rules when reflectinghelp
--reflect-unwrap-io-blocksunwrap input/output blocks the same as uniform blockshelp
--resource-set-bindings, --rsbsynonyms for --resource-set-bindinghelp
--sacbsynonym for set-atomic-counter-blockhelp
--sdubsynonym for set-default-uniform-blockhelp
--shift-image-bindings, --sibsynonyms for --shift-image-bindinghelp
--shift-sampler-bindings, --ssbsynonyms for --shift-sampler-bindinghelp
--shift-ssbo-bindings, --sbbsynonyms for --shift-ssbo-bindinghelp
--shift-texture-bindings, --stbsynonyms for --shift-texture-bindinghelp
--shift-uav-bindings, --suavbsynonyms for --shift-uav-bindinghelp
--spirv-disoutput standard-form disassembly;help
--spirv-valexecute the SPIRV-Tools validatorhelp
--stdinread from stdin instead of from a file;help
--uniform-base baseset a base to use for generated uniform locationshelp
--validate-iovalidate cross stage IOhelp
--bindings-per-resource-typehelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.