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

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

-D<macro=def>

define a pre-processor macro
print pre-processed GLSL; cannot be used with -l; errors will appear on stderr.
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
print human readable form of SPIR-V; turns on -V
add dir to the include search path; includer's directory is searched first, followed by left-to-right order of -I
disables optimization. May cause illegal SPIR-V for HLSL.
optimizes SPIR-V to minimize size.
uses specified stage rather than parsing the file extension choices for <stage> are vert, tesc, tese, geom, frag, or comp
undefine a pre-processor macro
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
configuration dump; creates the default configuration file (redirect to a .conf file)
default to desktop (#version 110) when there is no shader #version (default is ES version 100)
specify <name> as the entry-point name
generate debug information
print this usage message
intermediate tree (glslang AST) is printed out
link all input files together to form a single module
memory leak mode
save binary to <file>, requires a binary option (e.g., -V)
dump reflection query database
synonym for --relaxed-errors
silence syntax and semantic error reporting
multi-threaded mode
print version strings
synonym for --suppress-warnings
save binary output as text-based 32-bit hexadecimal numbers
automatically bind uniform variables without explicit bindings.
synonym for --auto-map-bindings
automatically locate input/output lacking 'location' (fragile, not cross stage)
synonym for --auto-map-locations
see -V and -G
flatten uniform texture/sampler arrays to scalars
synonym for --flatten-uniform-arrays
Allow block offsets to follow HLSL rules. Works independently of source language
Perform IO mapping in HLSL register space
don't eliminate uncalled functions
synonym for --keep-uncalled
use Unknown image format
synonym for --no-storage-format
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
synonym for --resource-set-binding
base binding number for images (uav)

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

synonym for --shift-image-binding
base binding number for samplers

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

synonym for --shift-sampler-binding
base binding number for SSBOs

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

synonym for --shift-ssbo-binding
base binding number for textures

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

synonym for --shift-texture-binding
base binding number for UAVs

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

synonym for --shift-uav-binding
base binding number for UBOs

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

synonym for --shift-UBO-binding

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

synonym for --shift-UBO-binding
the given shader source function is renamed to be the <name> given in -e
synonym for --source-entrypoint
Read from stdin instead of from a file. You'll have to provide the shader stageusing -S.
suppress GLSL warnings (except as required by #extension : warn)
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>
Creates a C header file that contains a uint32_t array named <name> initialized with the shader binary code.
synonym for --variable-name <name>

ALSO SEE

https://github.com/KhronosGroup/glslang

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

December 2017 glslangValidator