I'm testing a simple qml app with shader effect.
import QtQuick import QtQuick.Window Window { id: root width: 480 height: 480 visible: true title: qsTr("Hello World") property int step: 4 // define 'step' so visible: root.step > 3 works Rectangle { width: 480; height: 240 color: '#1e1e1e' Grid { anchors.centerIn: parent spacing: 20 rows: 2; columns: 4 Image { id: sourceImage width: 80; height: width source: 'qt-logo.png' } ShaderEffect { id: effect4 width: 80; height: width property variant source: sourceImage property real redChannel: 0.5 visible: root.step>3 NumberAnimation on redChannel { from: 0.0; to: 1.0; loops: Animation.Infinite; duration: 4000 } fragmentShader: "red3.frag.qsb" } } } }
red3.frag:
#version 440
layout(location=0) in vec2 qt_TexCoord0;
layout(location=0) out vec4 fragColor;
layout(std140, binding=0) uniform buf {
mat4 qt_Matrix;
float qt_Opacity;
float redChannel;
} ubuf;
layout(binding=1) uniform sampler2D source;
void main() { fragColor = texture(source, qt_TexCoord0) * vec4(ubuf.redChannel, 1.0, 1.0, 1.0) * ubuf.qt_Opacity; }
qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -o red3.frag.qsb red3.frag
I got the following log: ShaderEffect: 'redChannel' does not have a matching property
Qt6 qml fails to access uniforms via the uniform buffer, 'redChannel', but it can access 'source'.
I'm using lima, Qt6.8, eglfs_kms
How can I fix it?