Results 1 to 4 of 4

Thread: QT4.7 & QGLFormat::CoreProfile & shaders

  1. #1
    Join Date
    Dec 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QT4.7 & QGLFormat::CoreProfile & shaders

    QT 4.7 on Linux, video card nvidia GTX 460 with OpenGl 4.1 support.
    if I set QGLFormat to CoreProfile and request version above 3.1 (i.e format.setVersion(3.2), format.setVersion(4.1)) shaders fails to compile.
    I think shader below confirm OpenGl 4.1 standard specification
    "in vec4 vrtx;\n"
    "void main(void)\n"
    "{\n"
    "gl_Position = vrtx;\n"
    "gl_PointSize = 2;\n"
    "}\n")};
    but even this simple shader compilation fails. If i set profile to CompatibilityProfile, or set version below 3.2 it compiles fine.
    As I want to use latest core, I'll appreciate any advice on where to look to solve the matter.

    Regards,

    S

  2. #2
    Join Date
    Dec 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QT4.7 & QGLFormat::CoreProfile & shaders

    In addition to the above :
    format.setProfile(QGLFormat::CoreProfile);
    format.setVersion(4, 1);
    QGLFormat::hasOpenGL() - returns true
    this->context()->isValid() - returns true

    Next checkind for support of Vertex shader:
    shader->hasOpenGLShaders(QGLShader::Vertex, context()) - returns FALSE.

    ~> glxinfo | grep vendor returns:
    server glx vendor string: NVIDIA Corporation
    client glx vendor string: NVIDIA Corporation
    OpenGL vendor string: NVIDIA Corporation

    ~> glxinfo | grep render:
    direct rendering: Yes
    OpenGL renderer string: GeForce GTX 460/PCI/SSE2

    ~> glxinfo | grep Open
    OpenGL vendor string: NVIDIA Corporation
    OpenGL renderer string: GeForce GTX 460/PCI/SSE2
    OpenGL version string: 4.1.0 NVIDIA 260.19.29
    OpenGL extensions:

    So, I'm totally confused how with valid context and OpenGL 4.1 support I do not have support even for Vertex shader?

  3. #3
    Join Date
    Dec 2010
    Location
    Poland. Jelenia Góra.
    Posts
    7
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT4.7 & QGLFormat::CoreProfile & shaders

    I have the same problem. So i stay with CompabilityProfile. You can look on a working example from this post. I just provide in shader itself a #version 410 core. ( Any number representing a version of the language a compiler does not support will cause an error to be generated.) When i switched to CoreProfile in Format i get vertex errors and nothing on screen. Now I'm looking why, and checking how opengl is made in qt.
    Last edited by bartosz.kwasniewski; 26th December 2010 at 23:20.

  4. #4
    Join Date
    Dec 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QT4.7 & QGLFormat::CoreProfile & shaders

    In QT 4.7 qgl.h OpenGLVersionFlag defined up to v. 4.0. With gl3w https://github.com/skaslev/gl3w I was able to set 4.1 core profile, shaders compile fine, but I'm getting: warning C7568: #version 410 not fully supported on current GPU target profile. That's possible that QT has the same bug as glew:
    glGetString(GL_EXTENSIONS) being deprecated, an error is generated, no extension is returned and then GLEW fails to initialize. So currently, it’s not recommended to use GLEW with a core profile context.
    - I havn't check this, but their approach to wrapping opengl looks similar.

Similar Threads

  1. Replies: 0
    Last Post: 10th November 2010, 13:56
  2. OpenGL shaders and x11 forwarding
    By Wali in forum Qt Programming
    Replies: 0
    Last Post: 2nd November 2010, 21:38
  3. 4.5.2 =>4.6.3 OpenGL shaders+qrphicsview issue
    By medved6 in forum Qt Programming
    Replies: 1
    Last Post: 22nd August 2010, 19:33
  4. GLSL shaders, multitexturing and Qt
    By jcox23 in forum Qt Programming
    Replies: 0
    Last Post: 20th January 2010, 19:37
  5. GLSL shaders - keeping a value per fragment iteration
    By high_flyer in forum General Programming
    Replies: 3
    Last Post: 22nd June 2007, 15:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.