@@ -165,6 +165,7 @@ An input file of - represents standard input.
165165 vulkan1.1
166166 vulkan1.2
167167 vulkan1.3
168+ vulkan1.4
168169 vulkan # Same as vulkan1.0
169170 opengl4.5
170171 opengl # Same as opengl4.5
@@ -174,8 +175,9 @@ An input file of - represents standard input.
174175 required to be supported for the target environment.
175176 For example, default for vulkan1.0 is spv1.0, and
176177 the default for vulkan1.1 is spv1.3,
177- the default for vulkan1.2 is spv1.5.
178- the default for vulkan1.3 is spv1.6.
178+ the default for vulkan1.2 is spv1.5,
179+ the default for vulkan1.3 is spv1.6,
180+ the default for vulkan1.4 is spv1.6.
179181 Values are:
180182 spv1.0, spv1.1, spv1.2, spv1.3, spv1.4, spv1.5, spv1.6
181183 --version Display compiler version information.
@@ -265,8 +267,9 @@ int main(int argc, char** argv) {
265267
266268 // Sets binding base for the given uniform kind. If stage is
267269 // shader_glsl_infer_from_source then set it for all shader stages.
268- auto set_binding_base = [&compiler](
269- shaderc_shader_kind stage, shaderc_uniform_kind kind, uint32_t base) {
270+ auto set_binding_base = [&compiler](shaderc_shader_kind stage,
271+ shaderc_uniform_kind kind,
272+ uint32_t base) {
270273 if (stage == shaderc_glsl_infer_from_source)
271274 compiler.options ().SetBindingBase (kind, base);
272275 else
@@ -335,6 +338,15 @@ int main(int argc, char** argv) {
335338 compiler.options ().SetNanClamp (true );
336339 } else if (arg.starts_with (" -fpreserve-bindings" )) {
337340 compiler.options ().SetPreserveBindings (true );
341+ } else if (arg.starts_with (" -fmax-id-bound=" )) {
342+ const string_piece value_str = arg.substr (std::strlen (" -fmax-id-bound=" ));
343+ uint32_t bound = 0 ;
344+ if (!shaderc_util::ParseUint32 (value_str.str (), &bound)) {
345+ std::cerr << " glslc: error: invalid value '" << value_str << " ' in '"
346+ << arg << " '" << std::endl;
347+ return 1 ;
348+ }
349+ compiler.options ().SetMaxIdBound (bound);
338350 } else if (((u_kind = shaderc_uniform_kind_image),
339351 (arg == " -fimage-binding-base" )) ||
340352 ((u_kind = shaderc_uniform_kind_texture),
@@ -452,6 +464,9 @@ int main(int argc, char** argv) {
452464 } else if (target_env_str == " vulkan1.3" ) {
453465 target_env = shaderc_target_env_vulkan;
454466 version = shaderc_env_version_vulkan_1_3;
467+ } else if (target_env_str == " vulkan1.4" ) {
468+ target_env = shaderc_target_env_vulkan;
469+ version = shaderc_env_version_vulkan_1_4;
455470 } else if (target_env_str == " opengl" ) {
456471 target_env = shaderc_target_env_opengl;
457472 } else if (target_env_str == " opengl4.5" ) {
@@ -675,9 +690,10 @@ int main(int argc, char** argv) {
675690 // from the file name. If current_fshader_stage is specifed to one of
676691 // the forced shader kinds, use that for the following compilation.
677692 input_files.emplace_back (glslc::InputFileSpec{
678- arg.str (), (current_fshader_stage == shaderc_glsl_infer_from_source
679- ? glslc::DeduceDefaultShaderKindFromFileName (arg)
680- : current_fshader_stage),
693+ arg.str (),
694+ (current_fshader_stage == shaderc_glsl_infer_from_source
695+ ? glslc::DeduceDefaultShaderKindFromFileName (arg)
696+ : current_fshader_stage),
681697 language, current_entry_point_name});
682698 }
683699 }
0 commit comments