graph example: Do not use GLSL functions as uniform names
Using textureSize in the uniform block leads to renaming it to _textureSize when transpiling to GLSL. This is not reflected in the reflection metadata for some reason. For OpenGL this matters because the QRhi backend won't be correctly able to set up the uniforms when the names do not match. To overcome this, use a name in the shader that does not conflict with a built-in GLSL function. Strictly speaking the name (textureSize) is somewhat incorrect anyway. Use texCoordScale to express its meaning better. Pick-to: 6.7 6.6 6.5 6.2 Change-Id: I863e98c6d56cc46fad895763b9b5106a40e2952c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
parent
0c9d2fe802
commit
3d8c869768
|
@ -11,7 +11,7 @@ layout(location = 0) out vec4 fragColor;
|
|||
layout(std140, binding = 0) uniform buf {
|
||||
mat4 qt_Matrix;
|
||||
vec4 color;
|
||||
vec2 textureSize;
|
||||
vec2 texCoordScale;
|
||||
float qt_Opacity;
|
||||
};
|
||||
|
||||
|
|
Binary file not shown.
|
@ -9,7 +9,7 @@ layout(location = 1) out vec2 vShadeCoord;
|
|||
layout(std140, binding = 0) uniform buf {
|
||||
mat4 qt_Matrix;
|
||||
vec4 color;
|
||||
vec2 textureSize;
|
||||
vec2 texCoordScale;
|
||||
float qt_Opacity;
|
||||
};
|
||||
|
||||
|
@ -17,6 +17,6 @@ out gl_PerVertex { vec4 gl_Position; };
|
|||
|
||||
void main() {
|
||||
gl_Position = qt_Matrix * aVertex;
|
||||
vTexCoord = aVertex.xy * textureSize;
|
||||
vTexCoord = aVertex.xy * texCoordScale;
|
||||
vShadeCoord = aTexCoord;
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue