aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-09-06 16:32:03 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-09-07 09:43:08 +0200
commit6f2f198affaee5f1d036ad3fc25a317ce50c1839 (patch)
tree98ae24e34f98296a8d01a9eb3dae1b5bb2bfc2b9 /examples/quick
parent3f3c140d639813e15c95309a1356577f489ea4ff (diff)
Remove old GLSL code from fboitem example
There is no OpenGL path anymore in Qt 6, no point using file selectors. Change-Id: I4b7afbbb193dfe1a6e912a909babab0aeb8dcdda Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/scenegraph/fboitem/CMakeLists.txt3
-rw-r--r--examples/quick/scenegraph/fboitem/fboitem.qrc3
-rw-r--r--examples/quick/scenegraph/fboitem/main.qml2
-rw-r--r--examples/quick/scenegraph/fboitem/shaders/+qsb/checker.fragbin1615 -> 0 bytes
-rw-r--r--examples/quick/scenegraph/fboitem/shaders/checker.frag22
-rw-r--r--examples/quick/scenegraph/fboitem/shaders/checker.frag.qsbbin0 -> 953 bytes
-rw-r--r--examples/quick/scenegraph/fboitem/shaders/checker_rhi.frag22
7 files changed, 18 insertions, 34 deletions
diff --git a/examples/quick/scenegraph/fboitem/CMakeLists.txt b/examples/quick/scenegraph/fboitem/CMakeLists.txt
index 7111e96e5a..2f0fd4b631 100644
--- a/examples/quick/scenegraph/fboitem/CMakeLists.txt
+++ b/examples/quick/scenegraph/fboitem/CMakeLists.txt
@@ -40,8 +40,7 @@ target_link_libraries(fboitem PUBLIC
# Resources:
set(fboitem_resource_files
"main.qml"
- "shaders/+qsb/checker.frag"
- "shaders/checker.frag"
+ "shaders/checker.frag.qsb"
)
qt6_add_resources(fboitem "fboitem"
diff --git a/examples/quick/scenegraph/fboitem/fboitem.qrc b/examples/quick/scenegraph/fboitem/fboitem.qrc
index eeb5c36afd..1782429798 100644
--- a/examples/quick/scenegraph/fboitem/fboitem.qrc
+++ b/examples/quick/scenegraph/fboitem/fboitem.qrc
@@ -1,7 +1,6 @@
<RCC>
<qresource prefix="/scenegraph/fboitem">
<file>main.qml</file>
- <file>shaders/checker.frag</file>
- <file>shaders/+qsb/checker.frag</file>
+ <file>shaders/checker.frag.qsb</file>
</qresource>
</RCC>
diff --git a/examples/quick/scenegraph/fboitem/main.qml b/examples/quick/scenegraph/fboitem/main.qml
index 1f1829deda..02a2ae22d6 100644
--- a/examples/quick/scenegraph/fboitem/main.qml
+++ b/examples/quick/scenegraph/fboitem/main.qml
@@ -67,7 +67,7 @@ Item {
property size pixelSize: Qt.size(width / tileSize, height / tileSize);
- fragmentShader: "qrc:/scenegraph/fboitem/shaders/checker.frag"
+ fragmentShader: "qrc:/scenegraph/fboitem/shaders/checker.frag.qsb"
}
Renderer {
diff --git a/examples/quick/scenegraph/fboitem/shaders/+qsb/checker.frag b/examples/quick/scenegraph/fboitem/shaders/+qsb/checker.frag
deleted file mode 100644
index 5037899d19..0000000000
--- a/examples/quick/scenegraph/fboitem/shaders/+qsb/checker.frag
+++ /dev/null
Binary files differ
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;
}
diff --git a/examples/quick/scenegraph/fboitem/shaders/checker.frag.qsb b/examples/quick/scenegraph/fboitem/shaders/checker.frag.qsb
new file mode 100644
index 0000000000..77cbf0b867
--- /dev/null
+++ b/examples/quick/scenegraph/fboitem/shaders/checker.frag.qsb
Binary files differ
diff --git a/examples/quick/scenegraph/fboitem/shaders/checker_rhi.frag b/examples/quick/scenegraph/fboitem/shaders/checker_rhi.frag
deleted file mode 100644
index 1e4131d026..0000000000
--- a/examples/quick/scenegraph/fboitem/shaders/checker_rhi.frag
+++ /dev/null
@@ -1,22 +0,0 @@
-#version 440
-
-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()
-{
- vec2 tc = sign(sin(3.14159265358979323846 * qt_TexCoord0 * ubuf.pixelSize));
- if (tc.x != tc.y)
- fragColor = ubuf.color1;
- else
- fragColor = ubuf.color2;
-}