KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.95k stars 819 forks source link

how to compile a shader with old version? [glsl][question] #1673

Closed JamesZhang-AMD closed 5 years ago

JamesZhang-AMD commented 5 years ago

Hi all,

I am compiling a shader with old version, command> "glslangValidator shader.frag -G --aml" , but the the compiler report the issue: "ERROR: #version: Desktop shaders for OpenGL SPIR-V require version 330 or higher", I wonder is the glslang able to compile the shader with the version lower than 330 ?

Thanks

version 130

in vec4 Color; in vec4 texColor0; in vec4 texColor1; out vec4 FragColor;

void main() { FragColor = Color + texColor0 + texColor1; }

johnkslang commented 5 years ago

That reflects the required minimum #version 140 from the GL_KHR_vulkan_glsl specification.

Could you change 130 -> 140?