Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.4.0 Beta
-
Mac OSX 10.9.5, 15" MacBook Pro Early 2011
-
c1c259ea76c4d8c94f6d96c3fd0bbbece25785bf
Description
On first glance at Qt 5.4.0 Beta, it looks like a lot of work has been done to be compatible with newer OpenGL contexts. Thanks.
Any QML views that use the Graphical Effects 1.0 with a 4.1 Core context throw shader errors, and render solid purple instead of the intended effect. Switch back to 2.1 compatibility and the effects work as expected.
Here is the shader error from a ColorOverlay:
QOpenGLShader::compile(Fragment): ERROR: 0:1: '' : #version required and missing.
ERROR: 0:5: 'varying' : syntax error syntax error
-
-
- Problematic Fragment shader source code ***
#define lowp
#define mediump
#define highp
- Problematic Fragment shader source code ***
-
varying mediump vec2 qt_TexCoord0;
uniform highp float qt_Opacity;
uniform lowp sampler2D source;
uniform highp vec4 color;
void main()
***
QQuickCustomMaterialShader: Shader compilation failed:
"ERROR: 0:1: '' : #version required and missing.
ERROR: 0:5: 'varying' : syntax error syntax error
"
To reproduce, here are the pertinent code snippets I am using to set the context and create a simple hover over effect in QML:
QQuickView * m_pMainView = new QQuickView;
QSurfaceFormat f;
f.setProfile(QSurfaceFormat::CoreProfile);
f.setVersion(4, 1);
f.setSamples(16);
f.setDepthBufferSize(24);
m_pMainView->setSurfaceType(QSurface::OpenGLSurface);
m_pMainView->setFormat(f);
import QtQuick 2.3
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick.XmlListModel 2.0
import QtGraphicalEffects 1.0
Text {
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
text: "Hello QML"
ColorOverlay {
id: activeDeleteButton
opacity: 0
anchors.fill: parent
source: parent
color: "red"
MouseArea
}
}
Attachments
Issue Links
- is duplicated by
-
QTBUG-64019 QGraphicalEffects not compatible with OpenGL 3.2+ on macOS
-
- Closed
-