+ if(vulkan)
+ {
+ features = GL::SL::Features::latest(GL::VULKAN);
+ as_module = 1;
+ module_type = "spirv";
+ }
+ else if(target_version)
+ features = GL::SL::Features::from_api_version(GL::OPENGL, GL::Version(target_version/100, target_version%100));
+
+ if(as_module)
+ {
+ if(module_type=="glsl" || module_type=="GLSL")
+ compile_mode = GL::SL::Compiler::MODULE;
+ else if(module_type=="spirv" || module_type=="spir-v" || module_type=="SPIRV" || module_type=="SPIR-V")
+ compile_mode = GL::SL::Compiler::SPIRV;
+ else
+ throw usage_error("Invalid module type");
+ }
+
+ if(compile_mode==GL::SL::Compiler::SPIRV && out_filename.empty())
+ throw usage_error("-o is required for SPIR-V");
+
+ if(parse_only)
+ {
+ if(!stage_str.empty())
+ throw usage_error("-s can't be used with -p");
+ dump_ast = true;
+ }
+
+ if(!stage_str.empty() && compile_mode==GL::SL::Compiler::SPIRV)
+ throw usage_error("-s can't be used with SPIR-V");
+ else if(stage_str=="vertex")