Shaders: Compile correct GLSL version on legacy.

OpenGL versions below 3.3 will use GLSL version 1.50.
This lets slang shaders work on earlier versions.
This commit is contained in:
BearOso 2020-08-07 14:06:50 -05:00
parent e705e71a97
commit 668f1d967b
1 changed files with 2 additions and 0 deletions

View File

@ -167,6 +167,8 @@ GLint GLSLShader::slang_compile(std::vector<std::string> &lines,
spirv_cross::CompilerGLSL::Options opts;
opts.version = gl_version() * 10;
if (opts.version < 330 && opts.version > 150)
opts.version = 150;
opts.vulkan_semantics = false;
glsl.set_common_options(opts);