aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <[email protected]>2024-05-24 11:51:33 +0200
committerLaszlo Agocs <[email protected]>2024-05-27 09:36:13 +0200
commit3d8c86976844bc9507b0ff677188eee64e49b732 (patch)
tree7e6bb01bae9a7740a1d45b75fc9c35561bd8142e
parent0c9d2fe80255422e2375404b9e94b31ad62fec06 (diff)
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 <[email protected]>
-rw-r--r--examples/quick/scenegraph/graph/shaders/noisy.frag2
-rw-r--r--examples/quick/scenegraph/graph/shaders/noisy.frag.qsbbin1763 -> 1760 bytes
-rw-r--r--examples/quick/scenegraph/graph/shaders/noisy.vert4
-rw-r--r--examples/quick/scenegraph/graph/shaders/noisy.vert.qsbbin1650 -> 1646 bytes
4 files changed, 3 insertions, 3 deletions
diff --git a/examples/quick/scenegraph/graph/shaders/noisy.frag b/examples/quick/scenegraph/graph/shaders/noisy.frag
index 0b7cb1306b..0f13b83fd4 100644
--- a/examples/quick/scenegraph/graph/shaders/noisy.frag
+++ b/examples/quick/scenegraph/graph/shaders/noisy.frag
@@ -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;
};
diff --git a/examples/quick/scenegraph/graph/shaders/noisy.frag.qsb b/examples/quick/scenegraph/graph/shaders/noisy.frag.qsb
index 1a49e93cf3..dd1739b1fe 100644
--- a/examples/quick/scenegraph/graph/shaders/noisy.frag.qsb
+++ b/examples/quick/scenegraph/graph/shaders/noisy.frag.qsb
Binary files differ
diff --git a/examples/quick/scenegraph/graph/shaders/noisy.vert b/examples/quick/scenegraph/graph/shaders/noisy.vert
index 5728f2a02f..057f1c8d16 100644
--- a/examples/quick/scenegraph/graph/shaders/noisy.vert
+++ b/examples/quick/scenegraph/graph/shaders/noisy.vert
@@ -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;
}
diff --git a/examples/quick/scenegraph/graph/shaders/noisy.vert.qsb b/examples/quick/scenegraph/graph/shaders/noisy.vert.qsb
index ce2a828ead..9de384e3a6 100644
--- a/examples/quick/scenegraph/graph/shaders/noisy.vert.qsb
+++ b/examples/quick/scenegraph/graph/shaders/noisy.vert.qsb
Binary files differ