diff options
author | Laszlo Agocs <[email protected]> | 2024-05-24 11:51:33 +0200 |
---|---|---|
committer | Laszlo Agocs <[email protected]> | 2024-05-27 09:36:13 +0200 |
commit | 3d8c86976844bc9507b0ff677188eee64e49b732 (patch) | |
tree | 7e6bb01bae9a7740a1d45b75fc9c35561bd8142e | |
parent | 0c9d2fe80255422e2375404b9e94b31ad62fec06 (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.frag | 2 | ||||
-rw-r--r-- | examples/quick/scenegraph/graph/shaders/noisy.frag.qsb | bin | 1763 -> 1760 bytes | |||
-rw-r--r-- | examples/quick/scenegraph/graph/shaders/noisy.vert | 4 | ||||
-rw-r--r-- | examples/quick/scenegraph/graph/shaders/noisy.vert.qsb | bin | 1650 -> 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 Binary files differindex 1a49e93cf3..dd1739b1fe 100644 --- a/examples/quick/scenegraph/graph/shaders/noisy.frag.qsb +++ b/examples/quick/scenegraph/graph/shaders/noisy.frag.qsb 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 Binary files differindex ce2a828ead..9de384e3a6 100644 --- a/examples/quick/scenegraph/graph/shaders/noisy.vert.qsb +++ b/examples/quick/scenegraph/graph/shaders/noisy.vert.qsb |