Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.5.0
-
None
-
mac 10.10.4, Qt5.5, OpenGL 4
Description
I'm getting lots of shader compiler errors,
the issue is that we asked for an opengl 4.0 context and we want to do 2d overlay. The shader used inside Qt to perform OGL overlay is for opengl 2.1. they can't compile with the opengl 4.0 context.
the shaders are in QtGui/private/qopenglengineshadersource_p.h I think.
Please see the attached sample program.
Debugging starts
QOpenGLShader::compile(Vertex): ERROR: 0:1: '' : #version required and missing.
ERROR: 0:9: 'attribute' : syntax error: syntax error
-
-
- Problematic Vertex shader source code ***
#define lowp
#define mediump
#define highp
#line 1
- Problematic Vertex shader source code ***
-
void setPosition();
void main(void)
attribute highp vec2 vertexCoordsArray;
attribute highp vec3 pmvMatrix1;
attribute highp vec3 pmvMatrix2;
attribute highp vec3 pmvMatrix3;
void setPosition(void)
***
Vertex shader for simpleShaderProg (MainVertexShader & PositionOnlyVertexShader) failed to compile
QOpenGLShader::compile(Fragment): ERROR: 0:1: '' : #version required and missing.
-
-
- Problematic Fragment shader source code ***
#define lowp
#define mediump
#define highp
#line 1
- Problematic Fragment shader source code ***
-
lowp vec4 srcPixel();
void main()
lowp vec4 srcPixel()
{ return vec4(0.98, 0.06, 0.75, 1.0); }
***
Fragment shader for simpleShaderProg (MainFragmentShader & ShockingPinkSrcFragmentShader) failed to compile
QOpenGLShader::link: "ERROR: One or more attached shaders not successfully compiled\n"
Errors linking simple shader: ERROR: One or more attached shaders not successfully compiled
QOpenGLShader::compile(Vertex): ERROR: 0:1: '' : #version required and missing.
ERROR: 0:3: 'attribute' : syntax error: syntax error
*** Problematic Vertex shader source code ***
#define lowp
#define mediump
#define highp
#line 1
attribute highp vec2 textureCoordArray;
varying highp vec2 textureCoords;
void setPosition();
void main(void)
{ setPosition(); textureCoords = textureCoordArray; }
attribute highp vec4 vertexCoordsArray;
void setPosition(void)
{ gl_Position = vertexCoordsArray; }
***
Vertex shader for blitShaderProg (MainWithTexCoordsVertexShader & UntransformedPositionVertexShader) failed to compile
QOpenGLShader::compile(Fragment): ERROR: 0:1: '' : #version required and missing.
ERROR: 0:9: 'varying' : syntax error: syntax error
*** Problematic Fragment shader source code ***
#define lowp
#define mediump
#define highp
#line 1
lowp vec4 srcPixel();
void main()
{ gl_FragColor = srcPixel(); }
varying highp vec2 textureCoords;
uniform sampler2D imageTexture;
lowp vec4 srcPixel()
***
Fragment shader for blitShaderProg (MainFragmentShader & ImageSrcFragmentShader) failed to compile
QOpenGLShader::link: "ERROR: One or more attached shaders not successfully compiled\n"
Errors linking blit shader: ERROR: One or more attached shaders not successfully compiled
Attachments
Issue Links
- duplicates
-
QTBUG-33535 QOpenGLPaintDevice/QPainter doesn't paint to QWindow with Core profile of OpenGL 3.x/4.x
- Closed