Skip to content

Commit 9340ae5

Browse files
antiagainstdneto0
authored andcommitted
Re-order glslc help (almost) alphabetically and add -O, -Os, -O0
Fixes google#478
1 parent 5cd480f commit 9340ae5

2 files changed

Lines changed: 82 additions & 76 deletions

File tree

glslc/src/main.cc

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -60,72 +60,67 @@ An input file of - represents standard input.
6060
Automatically assign locations to uniform variables that
6161
don't have an explicit 'location' layout in the shader
6262
source.
63-
-fhlsl-iomap Use HLSL IO mappings for bindings.
63+
-fentry-point=<name>
64+
Specify the entry point name for HLSL compilation, for
65+
all subsequent source files. Default is "main".
6466
-fhlsl_functionality1, -fhlsl-functionality1
6567
Enable extension SPV_GOOGLE_hlsl_functionality1 for HLSL
6668
compilation.
69+
-fhlsl-iomap Use HLSL IO mappings for bindings.
70+
-fhlsl-offsets Use HLSL offset rules for packing members of blocks.
71+
Affects only GLSL. HLSL rules are always used for HLSL.
72+
-flimit=<settings>
73+
Specify resource limits. Each limit is specified by a limit
74+
name followed by an integer value. Tokens should be
75+
separated by whitespace. If the same limit is specified
76+
several times, only the last setting takes effect.
77+
-flimit-file <file>
78+
Set limits as specified in the given file.
79+
-fresource-set-binding [stage] <reg0> <set0> <binding0>
80+
[<reg1> <set1> <binding1>...]
81+
Explicitly sets the descriptor set and binding for
82+
HLSL resources, by register name. Optionally restrict
83+
it to a single stage.
84+
-fcbuffer-binding-base [stage] <value>
85+
Same as -fubo-binding-base.
6786
-fimage-binding-base [stage] <value>
6887
Sets the lowest automatically assigned binding number for
6988
images. Optionally only set it for a single shader stage.
7089
For HLSL, the resource register number is added to this
7190
base.
72-
-ftexture-binding-base [stage] <value>
73-
Sets the lowest automatically assigned binding number for
74-
textures. Optionally only set it for a single shader stage.
75-
For HLSL, the resource register number is added to this
76-
base.
7791
-fsampler-binding-base [stage] <value>
7892
Sets the lowest automatically assigned binding number for
7993
samplers Optionally only set it for a single shader stage.
8094
For HLSL, the resource register number is added to this
8195
base.
82-
-fubo-binding-base [stage] <value>
83-
Sets the lowest automatically assigned binding number for
84-
uniform buffer objects (UBO). Optionally only set it for
85-
a single shader stage.
86-
For HLSL, the resource register number is added to this
87-
base.
88-
-fcbuffer-binding-base [stage] <value>
89-
Same as -fubo-binding-base.
9096
-fssbo-binding-base [stage] <value>
9197
Sets the lowest automatically assigned binding number for
9298
shader storage buffer objects (SSBO). Optionally only set
9399
it for a single shader stage. Only affects GLSL.
100+
-ftexture-binding-base [stage] <value>
101+
Sets the lowest automatically assigned binding number for
102+
textures. Optionally only set it for a single shader stage.
103+
For HLSL, the resource register number is added to this
104+
base.
94105
-fuav-binding-base [stage] <value>
95106
For automatically assigned bindings for unordered access
96107
views (UAV), the register number is added to this base to
97108
determine the binding number. Optionally only set it for
98109
a single shader stage. Only affects HLSL.
99-
-fresource-set-binding [stage] <reg0> <set0> <binding0>
100-
[<reg1> <set1> <binding1>...]
101-
Explicitly sets the descriptor set and binding for
102-
HLSL resources, by register name. Optionally restrict
103-
it to a single stage.
104-
-fentry-point=<name>
105-
Specify the entry point name for HLSL compilation, for
106-
all subsequent source files. Default is "main".
107-
-flimit=<settings>
108-
Specify resource limits. Each limit is specified by a limit
109-
name followed by an integer value. Tokens should be
110-
separated by whitespace. If the same limit is specified
111-
several times, only the last setting takes effect.
112-
--show-limits Display available limit names and their default values.
113-
-flimit-file <file>
114-
Set limits as specified in the given file.
110+
-fubo-binding-base [stage] <value>
111+
Sets the lowest automatically assigned binding number for
112+
uniform buffer objects (UBO). Optionally only set it for
113+
a single shader stage.
114+
For HLSL, the resource register number is added to this
115+
base.
115116
-fshader-stage=<stage>
116117
Treat subsequent input files as having stage <stage>.
117118
Valid stages are vertex, vert, fragment, frag, tesscontrol,
118119
tesc, tesseval, tese, geometry, geom, compute, and comp.
119120
-g Generate source-level debug information.
120121
Currently this option has no effect.
121122
--help Display available options.
122-
--version Display compiler version information.
123123
-I <value> Add directory to include search path.
124-
-o <file> Write output to <file>.
125-
A file name of '-' represents standard output.
126-
-std=<value> Version and profile for GLSL input files. Possible values
127-
are concatenations of version and profile, e.g. 310es,
128-
450core, etc. Ignored for HLSL files.
129124
-mfmt=<format> Output SPIR-V binary code using the selected format. This
130125
option may be specified only when the compilation output is
131126
in SPIR-V binary code form. Available options include bin, c
@@ -136,7 +131,16 @@ An input file of - represents standard input.
136131
-MF <file> Write dependency output to the given file.
137132
-MT <target> Specify the target of the rule emitted by dependency
138133
generation.
134+
-O Optimize the generated SPIR-V code for better performance.
135+
-Os Optimize the generated SPIR-V code for smaller size.
136+
-O0 Disable optimization.
137+
-o <file> Write output to <file>.
138+
A file name of '-' represents standard output.
139+
-std=<value> Version and profile for GLSL input files. Possible values
140+
are concatenations of version and profile, e.g. 310es,
141+
450core, etc. Ignored for HLSL files.
139142
-S Only run preprocess and compilation steps.
143+
--show-limits Display available limit names and their default values.
140144
--target-env=<environment>
141145
Set the target client environment, and the semantics
142146
of warnings and errors. An optional suffix can specify
@@ -146,14 +150,13 @@ An input file of - represents standard input.
146150
vulkan # Same as vulkan1.0
147151
opengl4.5
148152
opengl # Same as opengl4.5
153+
--version Display compiler version information.
149154
-w Suppresses all warning messages.
150155
-Werror Treat all warnings as errors.
151156
-x <language> Treat subsequent input files as having type <language>.
152157
Valid languages are: glsl, hlsl.
153158
For files ending in .hlsl the default is hlsl.
154159
Otherwise the default is glsl.
155-
-fhlsl-offsets Use HLSL offset rules for packing members of blocks.
156-
Affects only GLSL. HLSL rules are always used for HLSL.
157160
)";
158161
}
159162

glslc/test/parameter_tests.py

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -65,72 +65,67 @@ class HelpParameters(
6565
Automatically assign locations to uniform variables that
6666
don't have an explicit 'location' layout in the shader
6767
source.
68-
-fhlsl-iomap Use HLSL IO mappings for bindings.
68+
-fentry-point=<name>
69+
Specify the entry point name for HLSL compilation, for
70+
all subsequent source files. Default is "main".
6971
-fhlsl_functionality1, -fhlsl-functionality1
7072
Enable extension SPV_GOOGLE_hlsl_functionality1 for HLSL
7173
compilation.
74+
-fhlsl-iomap Use HLSL IO mappings for bindings.
75+
-fhlsl-offsets Use HLSL offset rules for packing members of blocks.
76+
Affects only GLSL. HLSL rules are always used for HLSL.
77+
-flimit=<settings>
78+
Specify resource limits. Each limit is specified by a limit
79+
name followed by an integer value. Tokens should be
80+
separated by whitespace. If the same limit is specified
81+
several times, only the last setting takes effect.
82+
-flimit-file <file>
83+
Set limits as specified in the given file.
84+
-fresource-set-binding [stage] <reg0> <set0> <binding0>
85+
[<reg1> <set1> <binding1>...]
86+
Explicitly sets the descriptor set and binding for
87+
HLSL resources, by register name. Optionally restrict
88+
it to a single stage.
89+
-fcbuffer-binding-base [stage] <value>
90+
Same as -fubo-binding-base.
7291
-fimage-binding-base [stage] <value>
7392
Sets the lowest automatically assigned binding number for
7493
images. Optionally only set it for a single shader stage.
7594
For HLSL, the resource register number is added to this
7695
base.
77-
-ftexture-binding-base [stage] <value>
78-
Sets the lowest automatically assigned binding number for
79-
textures. Optionally only set it for a single shader stage.
80-
For HLSL, the resource register number is added to this
81-
base.
8296
-fsampler-binding-base [stage] <value>
8397
Sets the lowest automatically assigned binding number for
8498
samplers Optionally only set it for a single shader stage.
8599
For HLSL, the resource register number is added to this
86100
base.
87-
-fubo-binding-base [stage] <value>
88-
Sets the lowest automatically assigned binding number for
89-
uniform buffer objects (UBO). Optionally only set it for
90-
a single shader stage.
91-
For HLSL, the resource register number is added to this
92-
base.
93-
-fcbuffer-binding-base [stage] <value>
94-
Same as -fubo-binding-base.
95101
-fssbo-binding-base [stage] <value>
96102
Sets the lowest automatically assigned binding number for
97103
shader storage buffer objects (SSBO). Optionally only set
98104
it for a single shader stage. Only affects GLSL.
105+
-ftexture-binding-base [stage] <value>
106+
Sets the lowest automatically assigned binding number for
107+
textures. Optionally only set it for a single shader stage.
108+
For HLSL, the resource register number is added to this
109+
base.
99110
-fuav-binding-base [stage] <value>
100111
For automatically assigned bindings for unordered access
101112
views (UAV), the register number is added to this base to
102113
determine the binding number. Optionally only set it for
103114
a single shader stage. Only affects HLSL.
104-
-fresource-set-binding [stage] <reg0> <set0> <binding0>
105-
[<reg1> <set1> <binding1>...]
106-
Explicitly sets the descriptor set and binding for
107-
HLSL resources, by register name. Optionally restrict
108-
it to a single stage.
109-
-fentry-point=<name>
110-
Specify the entry point name for HLSL compilation, for
111-
all subsequent source files. Default is "main".
112-
-flimit=<settings>
113-
Specify resource limits. Each limit is specified by a limit
114-
name followed by an integer value. Tokens should be
115-
separated by whitespace. If the same limit is specified
116-
several times, only the last setting takes effect.
117-
--show-limits Display available limit names and their default values.
118-
-flimit-file <file>
119-
Set limits as specified in the given file.
115+
-fubo-binding-base [stage] <value>
116+
Sets the lowest automatically assigned binding number for
117+
uniform buffer objects (UBO). Optionally only set it for
118+
a single shader stage.
119+
For HLSL, the resource register number is added to this
120+
base.
120121
-fshader-stage=<stage>
121122
Treat subsequent input files as having stage <stage>.
122123
Valid stages are vertex, vert, fragment, frag, tesscontrol,
123124
tesc, tesseval, tese, geometry, geom, compute, and comp.
124125
-g Generate source-level debug information.
125126
Currently this option has no effect.
126127
--help Display available options.
127-
--version Display compiler version information.
128128
-I <value> Add directory to include search path.
129-
-o <file> Write output to <file>.
130-
A file name of '-' represents standard output.
131-
-std=<value> Version and profile for GLSL input files. Possible values
132-
are concatenations of version and profile, e.g. 310es,
133-
450core, etc. Ignored for HLSL files.
134129
-mfmt=<format> Output SPIR-V binary code using the selected format. This
135130
option may be specified only when the compilation output is
136131
in SPIR-V binary code form. Available options include bin, c
@@ -141,7 +136,16 @@ class HelpParameters(
141136
-MF <file> Write dependency output to the given file.
142137
-MT <target> Specify the target of the rule emitted by dependency
143138
generation.
139+
-O Optimize the generated SPIR-V code for better performance.
140+
-Os Optimize the generated SPIR-V code for smaller size.
141+
-O0 Disable optimization.
142+
-o <file> Write output to <file>.
143+
A file name of '-' represents standard output.
144+
-std=<value> Version and profile for GLSL input files. Possible values
145+
are concatenations of version and profile, e.g. 310es,
146+
450core, etc. Ignored for HLSL files.
144147
-S Only run preprocess and compilation steps.
148+
--show-limits Display available limit names and their default values.
145149
--target-env=<environment>
146150
Set the target client environment, and the semantics
147151
of warnings and errors. An optional suffix can specify
@@ -151,14 +155,13 @@ class HelpParameters(
151155
vulkan # Same as vulkan1.0
152156
opengl4.5
153157
opengl # Same as opengl4.5
158+
--version Display compiler version information.
154159
-w Suppresses all warning messages.
155160
-Werror Treat all warnings as errors.
156161
-x <language> Treat subsequent input files as having type <language>.
157162
Valid languages are: glsl, hlsl.
158163
For files ending in .hlsl the default is hlsl.
159164
Otherwise the default is glsl.
160-
-fhlsl-offsets Use HLSL offset rules for packing members of blocks.
161-
Affects only GLSL. HLSL rules are always used for HLSL.
162165
'''
163166

164167
expected_stderr = ''

0 commit comments

Comments
 (0)