Scroll to navigation

GLSLANGVALIDATOR(1) General Commands Manual GLSLANGVALIDATOR(1)

NAME

glslangValidator - OpenGL (ES) Shading Language Reference Compiler

SYNOPSIS

glslangValidator [OPTION]... [FILE]...

DESCRIPTION

Glslang is the official reference compiler front end for the OpenGL ES and OpenGL shading languages. It implements a strict interpretation of the specifications for these languages. It is open and free for anyone to use, either from a command line or programmatically. The OpenGL and OpenGL ES working groups are committed to maintaining consistency between the reference compiler and the corresponding shading language specifications.

The purpose of the reference compiler is to identify shader portability issues. If glslang accepts a shader without errors, then all OpenGL and OpenGL ES implementations claiming to support the shader's language version should also accept the shader without errors. Likewise, if glslang reports an error when compiling a shader, all OpenGL and OpenGL ES implementations for that language version should report errors, unless the glslang errors are caused by differences in implementation-defined limits or extension support.

Glslang can also be used to generate SPIR-V from GLSL. But this feature is experimental and non-optimized.

FILE

The file extension of FILE results in auto-stage classification:
.conf
to provide a config file that replaces the default configuration (see -c option below for generating a template)
.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

OPTIONS

-C
cascading errors; risk crash from accumulation of error recoveries
-D
input is HLSL

-D<macro=def>

-D<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 <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 and --target-env for OpenGL will also imply -G
-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
-Od
disables optimization. May cause illegal SPIR-V for HLSL.
-Os
optimizes SPIR-V to minimize size.
-S <stage>
uses specified stage rather than parsing the file extension choices for <stage> are vert, tesc, tese, geom, frag, or comp
-U<macro>
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 and --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>
specify <name> as the entry-point name
-g
generate debug information
-h
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
-r
synonym for --relaxed-errors
-s
silence syntax and semantic error reporting
-t
multi-threaded mode
-v
print version strings
-w
synonym for --suppress-warnings
-x
save binary output as text-based 32-bit hexadecimal numbers
--auto-map-bindings
automatically bind uniform variables without explicit bindings.
--amb
synonym for --auto-map-bindings
--auto-map-locations
automatically locate input/output lacking 'location' (fragile, not cross stage)
--aml
synonym for --auto-map-locations
--client {vulkan<ver>|opengl<ver>}
see -V and -G
--flatten-uniform-arrays
flatten uniform texture/sampler arrays to scalars
--fua
synonym for --flatten-uniform-arrays
--hlsl-offsets
Allow block offsets to follow HLSL rules. Works independently of source language
--hlsl-iomap
Perform IO mapping in HLSL register space
--keep-uncalled
don't eliminate uncalled functions
--ku
synonym for --keep-uncalled
--no-storage-format
use Unknown image format
--nsf
synonym for --no-storage-format
--relaxed-errors
relaxed GLSL semantic error-checking mode

--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
--rsb [stage] type set binding
synonym for --resource-set-binding
--shift-image-binding [stage] num
base binding number for images (uav)

--shift-image-binding [stage] [num set]... per-descriptor-set shift values

--sib [stage] num
synonym 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

--ssb [stage] num
synonym 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

--sbb [stage] num
synonym 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

--stb [stage] num
synonym 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

--suavb [stage] num
synonym 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-cbuffer-binding [stage] num
synonym for --shift-UBO-binding

--shift-cbuffer-binding [stage] [num set]... per-descriptor-set shift values

--sub [stage] num
synonym for --shift-UBO-binding
--source-entrypoint <name>
the given shader source function is renamed to be the <name> given in -e
--sep
synonym for --source-entrypoint
--stdin
Read from stdin instead of from a file. You'll have to provide the shader stageusing -S.
--suppress-warnings
suppress GLSL warnings (except as required by #extension : warn)
--target-env {vulkan1.0|opengl}
set the execution environment code will execute in (as opposed to language semantics selected by --client) defaults: 'vulkan1.0' under --client vulkan<ver> 'opengl' under --client opengl<ver>
--variable-name <name>
Creates a C header file that contains a uint32_t array named <name> initialized with the shader binary code.
--vn <name>
synonym for --variable-name <name>

ALSO SEE

https://github.com/KhronosGroup/glslang

https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/

December 2017 glslangValidator