#version not set in QOpenGLShader
-
Hello,
since i switched to Qt 5.4 and am using QOpenGLWidget now, i can not run any OpenGL Frament shaders anymore.
The problem is that my graphics driver (AMD) tells "Implicit version number 110 not supported by GL3 forward compatible context".
Okay, first I thought no problem - i can add the #version statement manually. But because Qt adds the defines "#define lowp..." automatically, but #version has to be set BEFORE any other code, it does not work: "#version must occur before any other program statement"
So why Qt does not add #version too? Is there any way to solve that?Thanks a lot
-
Looking at the bugtracker suggests this is a known problem but the only response seems to be "patches welcomed" :(
As a workaround you might try to use compatibility profile. -
I tried, but that doesn't change anything.
I can use my old code, but this should not be the solution...
Or I compile 5.4 myself, including the bugfix... ; ) -
If you do, consider contributing it to the qt-project. I can imagine many people waiting for that fix.
Oh, and if you want to keep it to yourself remember there might be license restrictions so check that before you get to work. -
Remove the whitespace between the start of your shader source code and the # in #version. QOpenGLShader::compileSourceCode will correctly insert its defines after any leading #version or #extension if you do so.
-