Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.14, 5.15
-
None
-
ff102f01ed25b80abb770c6c6ef82d877dd508a3 (qt-labs/qtshadertools/master)
Description
The core-compatible versions of the generated GLSL code contain binding qualifiers for samplers, which is only safe when GL_ARB_shading_language_420pack is supported.
#version 150 #ifdef GL_ARB_shading_language_420pack #extension GL_ARB_shading_language_420pack : require #endif #ifdef GL_ARB_separate_shader_objects #extension GL_ARB_separate_shader_objects : require #endif layout(binding = 1) uniform sampler2D qt_Texture;
For example, the OpenGL on macOS does not have this extension, so using a 4.1 core profile context leads to failing GLSL shader compilation. (using 2.1 would work since the 120 shader has no 'layout' in the first place)
For uniform blocks the same problem is not applicable, because we always enable SPVC_COMPILER_OPTION_GLSL_EMIT_UNIFORM_BUFFER_AS_PLAIN_UNIFORMS.
So perhaps we should also disable SPVC_COMPILER_OPTION_GLSL_ENABLE_420PACK_EXTENSION.