diff options
Diffstat (limited to 'glslc/README.asciidoc')
-rw-r--r-- | glslc/README.asciidoc | 55 |
1 files changed, 49 insertions, 6 deletions
diff --git a/glslc/README.asciidoc b/glslc/README.asciidoc index ba6375a..b1551cd 100644 --- a/glslc/README.asciidoc +++ b/glslc/README.asciidoc @@ -5,13 +5,20 @@ == Name -`glslc` - A command-line GLSL to SPIR-V compiler with Clang-compatible arguments. +`glslc` - A command-line GLSL/HLSL to SPIR-V compiler with +Clang-compatible arguments. == Synopsis ---- +glslc [--help] + +glslc [--show-limits] + glslc [-c|-S|-E] - [-x glsl] [-std=standard] + [-x ...] [-std=standard] + [-fentry-point=...] + [-flimit=...] [-fshader-stage=...] [--target-env=...] [-g] @@ -27,7 +34,7 @@ glslc [-c|-S|-E] === Input file languages -glslc accepts both GLSL source and SPIR-V assembly files as inputs. +glslc accepts both GLSL/HLSL source and SPIR-V assembly files as inputs. ==== Shader stage specification @@ -108,6 +115,12 @@ Otherwise, `--help` tells the glslc compiler to display all available options and exit. +==== `--show-limits` + +`--show-limits` shows default resource limits for shader compilation. The syntax +is the same as accepted by `-flimit=` and for the contents of the file specified +by `-flimit-file`. + ==== `-o` `-o` lets you specify the output file's name. It cannot be used when there are @@ -115,6 +128,34 @@ multiple files generated. A filename of `-` represents standard output. === Language and Mode Selection Options +[[option-f-entry-point]] +==== `-fentry-point=` + +`-fentry-point=<name>` lets you specify the entry point name. This is only +significant for HLSL compilation. The default is "main". + +[[option-f-limit]] +==== `-flimit=` + +`-flimit=<resource-limits>` lets you specify resource limits. +The argument should be a sequence of limit name, integer value pairs. Tokens +should be separated by whitespace. If the same limit is specified several +times, only the last setting takes effect. + +Use `--show-limits` to show the default values, and example syntax. + +This option affects all compiled shaders. + +[[option-f-limit-file]] +==== `-flimit-file` + +`-flimit-file <resource-limits-file>` lets you specify resource limits in a file. +The syntax of the file contents is the same as the argument to `-flimit=` and +the output of `--show-limits`. This option accepts Glslang resource configuration +files, e.g. as emitted by `glslangValidator -c`. + +This option affects all compiled shaders. + [[option-f-shader-stage]] ==== `-fshader-stage=` @@ -158,7 +199,8 @@ GLSL, e.g., `450`. `-std=` behaves as follows: -* `-std=` affects the version of all inputs passed to `glslc`. +* `-std=` affects the version of all GLSL inputs passed to `glslc`. +* `-std=` is ignored for HLSL inputs. * `-std=` overwrites `#version` directives in all input shaders, including those preceding the argument. * If a `-std=` argument specifies a different version from a `#version` @@ -189,8 +231,9 @@ under Vulkan semantics. ==== `-x` -`-x` lets you specify the language of the input shader files. Right now, the -only accepted argument is `glsl`. +`-x` lets you specify the language of the input shader files. Valid languages +are `glsl` and `hlsl`. If the file extension is `hlsl` then the default language +is HLSL. Otherwise the default is 'glsl'. [[compilation-stage-selection-options]] === Compilation Stage Selection Options |