Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. #version not set in QOpenGLShader
Forum Updated to NodeBB v4.3 + New Features

#version not set in QOpenGLShader

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Powerpaule
    wrote on last edited by
    #1

    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

    Y 1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Powerpaule
        wrote on last edited by
        #3

        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... ; )

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AndrewTomazos
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • P Powerpaule

              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

              Y Offline
              Y Offline
              yoavmil
              wrote on last edited by
              #6

              @Powerpaule
              check if it is related to this post
              http://forum.qt.io/topic/56810/qt3d-demos-qopenglshader-compile-vertex-error-2-1-syntax-error-version-is-mandatory-and-should-be-set-before-any-other-token-qopenglshader-link-error-definition-for-void-main-not-found-n/7

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved