Usage: glslang [option]... [file]... 'file' with one of the following three endings can be auto-classified: 1) ., where 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) ..glsl or ..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 | --D | --define-macro 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 .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 add 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 | --P | --preamble-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 uses the specified rather than parsing the file extension; choices for include vert, tesc, tese, geom, frag, and comp; a full list of options is given above -U | --undef-macro | --U undefine a pre-processor macro -V[ver] create SPIR-V binary under Vulkan semantics; turns on -l; default file name is .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 | --entry-point specify 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 save binary to ; 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: 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 | opengl} see -V and -G --depfile 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 [name] [binding]... set descriptor set and binding for individual resources --resource-set-binding [stage] set descriptor set for all resources --resource-set-bindings | --rsb synonyms for --resource-set-binding --set-atomic-counter-block 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 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] base binding number for images (UAV) --shift-image-binding [stage] ... per-descriptor-set shift values --shift-image-bindings | --sib synonyms for --shift-image-binding --shift-sampler-binding [stage] base binding number for samplers --shift-sampler-binding [stage] ... per-descriptor-set shift values --shift-sampler-bindings | --ssb synonyms for --shift-sampler-binding --shift-ssbo-binding [stage] base binding number for SSBOs --shift-ssbo-binding [stage] ... per-descriptor-set shift values --shift-ssbo-bindings | --sbb synonyms for --shift-ssbo-binding --shift-texture-binding [stage] base binding number for textures --shift-texture-binding [stage] ... per-descriptor-set shift values --shift-texture-bindings | --stb synonyms for --shift-texture-binding --shift-uav-binding [stage] base binding number for UAVs --shift-uav-binding [stage] ... per-descriptor-set shift values --shift-uav-bindings | --suavb synonyms for --shift-uav-binding --shift-ubo-binding [stage] base binding number for UBOs --shift-ubo-binding [stage] ... 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] base binding number for combined samplers --shift-combined-sampler-binding [stage] ... per-descriptor-set shift values --shift-combined-sampler-bindings | --scsb synonyms for --shift-combined-sampler-binding --shift-as-binding [stage] base binding number for acceleration structures --shift-as-binding [stage] ... 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 | --sep the given shader source function is renamed to be the 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 * opengl under --client opengl * 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 set a base to use for generated uniform locations --variable-name | --vn creates a C header file that contains a uint32_t array named initialized with the shader binary code --validate-io validate cross stage IO --bindings-per-resource-type