glslc - Compile shaders into SPIR-V Usage: glslc [options] file... An input file of - represents standard input. Options: -c Only run preprocess, compile, and assemble steps. -Dmacro[=defn] Add an implicit macro definition. -E Outputs only the results of the preprocessing step. Output defaults to standard output. -fauto-bind-uniforms Automatically assign bindings to uniform variables that don't have an explicit 'binding' layout in the shader source. -fauto-map-locations Automatically assign locations to uniform variables that don't have an explicit 'location' layout in the shader source. -fauto-combined-image-sampler Removes sampler variables and converts existing textures to combined image-samplers. -fentry-point= Specify the entry point name for HLSL compilation, for all subsequent source files. Default is "main". -fhlsl-16bit-types Enable 16-bit type support for HLSL. -fhlsl_functionality1, -fhlsl-functionality1 Enable extension SPV_GOOGLE_hlsl_functionality1 for HLSL compilation. -fhlsl-iomap Use HLSL IO mappings for bindings. -fhlsl-offsets Use HLSL offset rules for packing members of blocks. Affects only GLSL. HLSL rules are always used for HLSL. -finvert-y Invert position.Y output in vertex shader. -flimit= Specify resource limits. Each limit is specified by a limit name followed by an integer value. Tokens should be separated by whitespace. If the same limit is specified several times, only the last setting takes effect. -flimit-file Set limits as specified in the given file. -fnan-clamp Generate code for max and min builtins so that, when given a NaN operand, the other operand is returned. Similarly, the clamp builtin will favour the non-NaN operands, as if clamp were implemented as a composition of max and min. -fpreserve-bindings Preserve all binding declarations, even if those bindings are not used. -fresource-set-binding [stage] [ ...] Explicitly sets the descriptor set and binding for HLSL resources, by register name. Optionally restrict it to a single stage. -fcbuffer-binding-base [stage] Same as -fubo-binding-base. -fimage-binding-base [stage] Sets the lowest automatically assigned binding number for images. Optionally only set it for a single shader stage. For HLSL, the resource register number is added to this base. -fsampler-binding-base [stage] Sets the lowest automatically assigned binding number for samplers Optionally only set it for a single shader stage. For HLSL, the resource register number is added to this base. -fssbo-binding-base [stage] Sets the lowest automatically assigned binding number for shader storage buffer objects (SSBO). Optionally only set it for a single shader stage. Only affects GLSL. -ftexture-binding-base [stage] Sets the lowest automatically assigned binding number for textures. Optionally only set it for a single shader stage. For HLSL, the resource register number is added to this base. -fuav-binding-base [stage] For automatically assigned bindings for unordered access views (UAV), the register number is added to this base to determine the binding number. Optionally only set it for a single shader stage. Only affects HLSL. -fubo-binding-base [stage] Sets the lowest automatically assigned binding number for uniform buffer objects (UBO). Optionally only set it for a single shader stage. For HLSL, the resource register number is added to this base. -fshader-stage= Treat subsequent input files as having stage . Valid stages are vertex, vert, fragment, frag, tesscontrol, tesc, tesseval, tese, geometry, geom, compute, comp, raygen, rgen, anyhit, rahit, closest, rchit, miss, rmiss, intersect, rint, callable, rcall, task, and mesh. -g Generate source-level debug information. -h Display available options. --help Display available options. -I Add directory to include search path. -mfmt= Output SPIR-V binary code using the selected format. This option may be specified only when the compilation output is in SPIR-V binary code form. Available options are: bin - SPIR-V binary words. This is the default. c - Binary words as C initializer list of 32-bit ints num - List of comma-separated 32-bit hex integers -M Generate make dependencies. Implies -E and -w. -MM An alias for -M. -MD Generate make dependencies and compile. -MF Write dependency output to the given file. -MT Specify the target of the rule emitted by dependency generation. -O Optimize the generated SPIR-V code for better performance. -Os Optimize the generated SPIR-V code for smaller size. -O0 Disable optimization. -o Write output to . A file name of '-' represents standard output. -std= Version and profile for GLSL input files. Possible values are concatenations of version and profile, e.g. 310es, 450core, etc. Ignored for HLSL files. -S Emit SPIR-V assembly instead of binary. --show-limits Display available limit names and their default values. --target-env= Set the target client environment, and the semantics of warnings and errors. An optional suffix can specify the client version. Values are: vulkan1.0 # The default vulkan1.1 vulkan1.2 vulkan1.3 vulkan1.4 vulkan # Same as vulkan1.0 opengl4.5 opengl # Same as opengl4.5 --target-spv= Set the SPIR-V version to be used for the generated SPIR-V module. The default is the highest version of SPIR-V required to be supported for the target environment. For example, default for vulkan1.0 is spv1.0, and the default for vulkan1.1 is spv1.3, the default for vulkan1.2 is spv1.5, the default for vulkan1.3 is spv1.6, the default for vulkan1.4 is spv1.6. Values are: spv1.0, spv1.1, spv1.2, spv1.3, spv1.4, spv1.5, spv1.6 --version Display compiler version information. -w Suppresses all warning messages. -Werror Treat all warnings as errors. -x Treat subsequent input files as having type . Valid languages are: glsl, hlsl. For files ending in .hlsl the default is hlsl. Otherwise the default is glsl.