From 6f2f198affaee5f1d036ad3fc25a317ce50c1839 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sun, 6 Sep 2020 16:32:03 +0200 Subject: 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 --- examples/quick/scenegraph/fboitem/CMakeLists.txt | 3 +-- examples/quick/scenegraph/fboitem/fboitem.qrc | 3 +-- examples/quick/scenegraph/fboitem/main.qml | 2 +- .../scenegraph/fboitem/shaders/+qsb/checker.frag | Bin 1615 -> 0 bytes .../quick/scenegraph/fboitem/shaders/checker.frag | 22 ++++++++++++++------- .../scenegraph/fboitem/shaders/checker.frag.qsb | Bin 0 -> 953 bytes .../scenegraph/fboitem/shaders/checker_rhi.frag | 22 --------------------- 7 files changed, 18 insertions(+), 34 deletions(-) delete mode 100644 examples/quick/scenegraph/fboitem/shaders/+qsb/checker.frag create mode 100644 examples/quick/scenegraph/fboitem/shaders/checker.frag.qsb delete mode 100644 examples/quick/scenegraph/fboitem/shaders/checker_rhi.frag (limited to 'examples/quick') 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 @@ main.qml - shaders/checker.frag - shaders/+qsb/checker.frag + shaders/checker.frag.qsb 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 Binary files a/examples/quick/scenegraph/fboitem/shaders/+qsb/checker.frag and /dev/null 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 Binary files /dev/null and b/examples/quick/scenegraph/fboitem/shaders/checker.frag.qsb 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; -} -- cgit v1.2.3