|
| 1 | +# glslangValidator |
| 2 | + |
| 3 | +``` |
| 4 | +Usage: glslangValidator [option]... [file]... |
| 5 | +
|
| 6 | +'file' can end in .<stage> for auto-stage classification, where <stage> is: |
| 7 | + .conf to provide a config file that replaces the default configuration |
| 8 | + (see -c option below for generating a template) |
| 9 | + .vert for a vertex shader |
| 10 | + .tesc for a tessellation control shader |
| 11 | + .tese for a tessellation evaluation shader |
| 12 | + .geom for a geometry shader |
| 13 | + .frag for a fragment shader |
| 14 | + .comp for a compute shader |
| 15 | + .mesh for a mesh shader |
| 16 | + .task for a task shader |
| 17 | + .rgen for a ray generation shader |
| 18 | + .rint for a ray intersection shader |
| 19 | + .rahit for a ray any hit shader |
| 20 | + .rchit for a ray closest hit shader |
| 21 | + .rmiss for a ray miss shader |
| 22 | + .rcall for a ray callable shader |
| 23 | + .glsl for .vert.glsl, .tesc.glsl, ..., .comp.glsl compound suffixes |
| 24 | + .hlsl for .vert.hlsl, .tesc.hlsl, ..., .comp.hlsl compound suffixes |
| 25 | +
|
| 26 | +Options: |
| 27 | + -C cascading errors; risk crash from accumulation of error recoveries |
| 28 | + -D input is HLSL (this is the default when any suffix is .hlsl) |
| 29 | + -D<name[=def]> | --define-macro <name[=def]> | --D <name[=def]> |
| 30 | + define a pre-processor macro |
| 31 | + -E print pre-processed GLSL; cannot be used with -l; |
| 32 | + errors will appear on stderr |
| 33 | + -G[ver] create SPIR-V binary, under OpenGL semantics; turns on -l; |
| 34 | + default file name is <stage>.spv (-o overrides this); |
| 35 | + 'ver', when present, is the version of the input semantics, |
| 36 | + which will appear in #define GL_SPIRV ver; |
| 37 | + '--client opengl100' is the same as -G100; |
| 38 | + a '--target-env' for OpenGL will also imply '-G'; |
| 39 | + currently only supports GLSL |
| 40 | + -H print human readable form of SPIR-V; turns on -V |
| 41 | + -I<dir> add dir to the include search path; includer's directory |
| 42 | + is searched first, followed by left-to-right order of -I |
| 43 | + -Od disables optimization; may cause illegal SPIR-V for HLSL |
| 44 | + -Os optimizes SPIR-V to minimize size |
| 45 | + -S <stage> uses specified stage rather than parsing the file extension |
| 46 | + choices for <stage> are vert, tesc, tese, geom, frag, or comp |
| 47 | + -U<name> | --undef-macro <name> | --U <name> |
| 48 | + undefine a pre-processor macro |
| 49 | + -V[ver] create SPIR-V binary, under Vulkan semantics; turns on -l; |
| 50 | + default file name is <stage>.spv (-o overrides this) |
| 51 | + 'ver', when present, is the version of the input semantics, |
| 52 | + which will appear in #define VULKAN ver |
| 53 | + '--client vulkan100' is the same as -V100 |
| 54 | + a '--target-env' for Vulkan will also imply '-V' |
| 55 | + -c configuration dump; |
| 56 | + creates the default configuration file (redirect to a .conf file) |
| 57 | + -d default to desktop (#version 110) when there is no shader #version |
| 58 | + (default is ES version 100) |
| 59 | + -e <name> | --entry-point <name> |
| 60 | + specify <name> as the entry-point function name |
| 61 | + -f{hlsl_functionality1} |
| 62 | + 'hlsl_functionality1' enables use of the |
| 63 | + SPV_GOOGLE_hlsl_functionality1 extension |
| 64 | + -g generate debug information |
| 65 | + -g0 strip debug information |
| 66 | + -h print this usage message |
| 67 | + -i intermediate tree (glslang AST) is printed out |
| 68 | + -l link all input files together to form a single module |
| 69 | + -m memory leak mode |
| 70 | + -o <file> save binary to <file>, requires a binary option (e.g., -V) |
| 71 | + -q dump reflection query database; requires -l for linking |
| 72 | + -r | --relaxed-errors relaxed GLSL semantic error-checking mode |
| 73 | + -s silence syntax and semantic error reporting |
| 74 | + -t multi-threaded mode |
| 75 | + -v | --version |
| 76 | + print version strings |
| 77 | + -w | --suppress-warnings |
| 78 | + suppress GLSL warnings, except as required by "#extension : warn" |
| 79 | + -x save binary output as text-based 32-bit hexadecimal numbers |
| 80 | + -u<name>:<loc> specify a uniform location override for --aml |
| 81 | + --uniform-base <base> set a base to use for generated uniform locations |
| 82 | + --auto-map-bindings | --amb automatically bind uniform variables |
| 83 | + without explicit bindings |
| 84 | + --auto-map-locations | --aml automatically locate input/output lacking |
| 85 | + 'location' (fragile, not cross stage) |
| 86 | + --client {vulkan<ver>|opengl<ver>} see -V and -G |
| 87 | + --dump-builtin-symbols prints builtin symbol table prior each compile |
| 88 | + -dumpfullversion | -dumpversion print bare major.minor.patchlevel |
| 89 | + --flatten-uniform-arrays | --fua flatten uniform texture/sampler arrays to |
| 90 | + scalars |
| 91 | + --hlsl-offsets allow block offsets to follow HLSL rules |
| 92 | + works independently of source language |
| 93 | + --hlsl-iomap perform IO mapping in HLSL register space |
| 94 | + --hlsl-enable-16bit-types allow 16-bit types in SPIR-V for HLSL |
| 95 | + --hlsl-dx9-compatible interprets sampler declarations as a |
| 96 | + texture/sampler combo like DirectX9 would, |
| 97 | + and recognizes DirectX9-specific semantics |
| 98 | + --invert-y | --iy invert position.Y output in vertex shader |
| 99 | + --keep-uncalled | --ku don't eliminate uncalled functions |
| 100 | + --nan-clamp favor non-NaN operand in min, max, and clamp |
| 101 | + --no-storage-format | --nsf use Unknown image format |
| 102 | + --quiet do not print anything to stdout, unless |
| 103 | + requested by another option |
| 104 | + --reflect-strict-array-suffix use strict array suffix rules when |
| 105 | + reflecting |
| 106 | + --reflect-basic-array-suffix arrays of basic types will have trailing [0] |
| 107 | + --reflect-intermediate-io reflection includes inputs/outputs of linked |
| 108 | + shaders rather than just vertex/fragment |
| 109 | + --reflect-separate-buffers reflect buffer variables and blocks |
| 110 | + separately to uniforms |
| 111 | + --reflect-all-block-variables reflect all variables in blocks, whether |
| 112 | + inactive or active |
| 113 | + --reflect-unwrap-io-blocks unwrap input/output blocks the same as |
| 114 | + uniform blocks |
| 115 | + --resource-set-binding [stage] name set binding |
| 116 | + set descriptor set and binding for |
| 117 | + individual resources |
| 118 | + --resource-set-binding [stage] set |
| 119 | + set descriptor set for all resources |
| 120 | + --rsb synonym for --resource-set-binding |
| 121 | + --shift-image-binding [stage] num |
| 122 | + base binding number for images (uav) |
| 123 | + --shift-image-binding [stage] [num set]... |
| 124 | + per-descriptor-set shift values |
| 125 | + --sib synonym for --shift-image-binding |
| 126 | + --shift-sampler-binding [stage] num |
| 127 | + base binding number for samplers |
| 128 | + --shift-sampler-binding [stage] [num set]... |
| 129 | + per-descriptor-set shift values |
| 130 | + --ssb synonym for --shift-sampler-binding |
| 131 | + --shift-ssbo-binding [stage] num base binding number for SSBOs |
| 132 | + --shift-ssbo-binding [stage] [num set]... |
| 133 | + per-descriptor-set shift values |
| 134 | + --sbb synonym for --shift-ssbo-binding |
| 135 | + --shift-texture-binding [stage] num |
| 136 | + base binding number for textures |
| 137 | + --shift-texture-binding [stage] [num set]... |
| 138 | + per-descriptor-set shift values |
| 139 | + --stb synonym for --shift-texture-binding |
| 140 | + --shift-uav-binding [stage] num base binding number for UAVs |
| 141 | + --shift-uav-binding [stage] [num set]... |
| 142 | + per-descriptor-set shift values |
| 143 | + --suavb synonym for --shift-uav-binding |
| 144 | + --shift-UBO-binding [stage] num base binding number for UBOs |
| 145 | + --shift-UBO-binding [stage] [num set]... |
| 146 | + per-descriptor-set shift values |
| 147 | + --sub synonym for --shift-UBO-binding |
| 148 | + --shift-cbuffer-binding | --scb synonyms for --shift-UBO-binding |
| 149 | + --spirv-dis output standard-form disassembly; works only |
| 150 | + when a SPIR-V generation option is also used |
| 151 | + --spirv-val execute the SPIRV-Tools validator |
| 152 | + --source-entrypoint <name> the given shader source function is |
| 153 | + renamed to be the <name> given in -e |
| 154 | + --sep synonym for --source-entrypoint |
| 155 | + --stdin read from stdin instead of from a file; |
| 156 | + requires providing the shader stage using -S |
| 157 | + --target-env {vulkan1.0 | vulkan1.1 | vulkan1.2 | opengl | |
| 158 | + spirv1.0 | spirv1.1 | spirv1.2 | spirv1.3 | spirv1.4 | spirv1.5} |
| 159 | + Set the execution environment that the |
| 160 | + generated code will be executed in. |
| 161 | + Defaults to: |
| 162 | + * vulkan1.0 under --client vulkan<ver> |
| 163 | + * opengl under --client opengl<ver> |
| 164 | + * spirv1.0 under --target-env vulkan1.0 |
| 165 | + * spirv1.3 under --target-env vulkan1.1 |
| 166 | + * spirv1.5 under --target-env vulkan1.2 |
| 167 | + Multiple --target-env can be specified. |
| 168 | + --variable-name <name> |
| 169 | + --vn <name> creates a C header file that contains a |
| 170 | + uint32_t array named <name> |
| 171 | + initialized with the shader binary code |
| 172 | +``` |
0 commit comments