From d16d0c4bbf0667533b0f0748e9eb93f1ac2e973c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 18 Feb 2021 19:21:28 +0100 Subject: Fix custommaterial example with OpenGL The member names in the "uniform block" (which is in practice mapped to a struct uniform with GLSL) must match between the vertex and fragment shaders, even if the member is not used in one of the shaders. This is because OpenGL/GLSL's interface matching rules, which would cause the shader program fail to link due to a mismatch in the structs in the two shaders. Change-Id: I9a928b4b20fdff14530c16a93a52967ce6c328a3 Reviewed-by: Shawn Rutledge (cherry picked from commit 21d9cd844e5c572b03b73400c110adc6fc78ae75) Reviewed-by: Qt Cherry-pick Bot --- .../custommaterial/shaders/mandelbrot.frag.qsb | Bin 2605 -> 2538 bytes .../scenegraph/custommaterial/shaders/mandelbrot.vert | 2 +- .../custommaterial/shaders/mandelbrot.vert.qsb | Bin 1643 -> 1547 bytes 3 files changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/quick/scenegraph') diff --git a/examples/quick/scenegraph/custommaterial/shaders/mandelbrot.frag.qsb b/examples/quick/scenegraph/custommaterial/shaders/mandelbrot.frag.qsb index dce5a9d934..550c0377ae 100644 Binary files a/examples/quick/scenegraph/custommaterial/shaders/mandelbrot.frag.qsb and b/examples/quick/scenegraph/custommaterial/shaders/mandelbrot.frag.qsb differ diff --git a/examples/quick/scenegraph/custommaterial/shaders/mandelbrot.vert b/examples/quick/scenegraph/custommaterial/shaders/mandelbrot.vert index 00c519cd9d..79813253d1 100644 --- a/examples/quick/scenegraph/custommaterial/shaders/mandelbrot.vert +++ b/examples/quick/scenegraph/custommaterial/shaders/mandelbrot.vert @@ -8,7 +8,7 @@ layout(location = 0) out vec2 vTexCoord; layout(std140, binding = 0) uniform buf { mat4 qt_Matrix; float qt_Opacity; - float scale; + float zoom; vec2 center; int limit; } ubuf; diff --git a/examples/quick/scenegraph/custommaterial/shaders/mandelbrot.vert.qsb b/examples/quick/scenegraph/custommaterial/shaders/mandelbrot.vert.qsb index 445b986ebd..ba2904d1c9 100644 Binary files a/examples/quick/scenegraph/custommaterial/shaders/mandelbrot.vert.qsb and b/examples/quick/scenegraph/custommaterial/shaders/mandelbrot.vert.qsb differ -- cgit v1.2.3