aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/fboitem/shaders/checker.frag
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/scenegraph/fboitem/shaders/checker.frag')
-rw-r--r--examples/quick/scenegraph/fboitem/shaders/checker.frag22
1 files changed, 15 insertions, 7 deletions
diff --git a/examples/quick/scenegraph/fboitem/shaders/checker.frag b/examples/quick/scenegraph/fboitem/shaders/checker.frag
index 044b3bad58..1e4131d026 100644
--- a/examples/quick/scenegraph/fboitem/shaders/checker.frag
+++ b/examples/quick/scenegraph/fboitem/shaders/checker.frag
@@ -1,14 +1,22 @@
-uniform lowp vec4 color1;
-uniform lowp vec4 color2;
-uniform highp vec2 pixelSize;
+#version 440
-varying highp vec2 qt_TexCoord0;
+layout(std140, binding = 0) uniform buf {
+ mat4 qt_Matrix;
+ float qt_Opacity;
+
+ vec4 color1;
+ vec4 color2;
+ vec2 pixelSize;
+} ubuf;
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
void main()
{
- highp vec2 tc = sign(sin(3.14159265358979323846 * qt_TexCoord0 * pixelSize));
+ vec2 tc = sign(sin(3.14159265358979323846 * qt_TexCoord0 * ubuf.pixelSize));
if (tc.x != tc.y)
- gl_FragColor = color1;
+ fragColor = ubuf.color1;
else
- gl_FragColor = color2;
+ fragColor = ubuf.color2;
}