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. OpenGL 3.2 core profile, QT 4.8 RC1 not working on Windows and Mac
Forum Updated to NodeBB v4.3 + New Features

OpenGL 3.2 core profile, QT 4.8 RC1 not working on Windows and Mac

Scheduled Pinned Locked Moved General and Desktop
21 Posts 8 Posters 14.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.
  • B Offline
    B Offline
    Bobby B
    wrote on last edited by
    #11

    Thanks for the reply. I see that you've put in quite a lot of effort to work around this problem. I too hope that this problem will be fixed soon. In the mean time I'll try implementing your method, or at least just stick with Windows for just a while longer.

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #12

      Sorry to necropost. I am now able to reproduce the buffer overflow as mentioned by the OP. I have made a non-Qt windows OpenGL app that acquires an OpenGL 4.2 core profile context which works fine. So it appears that something is going wrong in the Qt context creation code.

      Is anybody able to reproduce this on an ATI card on windows? Although I suspect it is not a driver issue but just something else to rule out.

      I have stepped through the Qt OpenGL context creation code and from what I can see so far all appears to be fine. It creates a temporary context, resolves some function entry points, then creates a core profile context using the same options as my non-Qt app. Yes when it comes to call glGetStringi( GL_EXTENSIONS, i ); it seems that some sort of stack corruption is occurring as the debugger shows the value of "this" changing each time this function is called.

      I'll keep digging but if I can't resolve it soon I'll file a bug report.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mike Dinsdale
        wrote on last edited by
        #13

        I think I've also run into the buffer overflow (or at least stack corruption of some kind) in the call to glGetStringi. I suspect "this":http://developer.qt.nokia.com/forums/viewthread/4495/P15 is the same issue as well. Actually exactly the same problem was discussed in comments on the bug report which originally introduced this code, "QTBUG-11052":https://bugreports.qt-project.org/browse/QTBUG-11052. The fix was to add the missing APIENTRY macro to the qt_glGetStringi function pointer typedef (it makes sense that leaving this off would lead to stack corruption). However the APIENTRY wasn't included in the version of the code that was eventually commited in commit 2f59eaee. I've verified that adding the APIENTRY does fix the problem for me, but perhaps it causes problems on some platforms? (I'm on Win 7 64-bit with a GT545).

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #14

          Well spotted! Thanks for the tip. I am on the road at the moment but will try this fix when I return home at the weekend. I'll post back here with the results. Thanks again!

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            ZapB
            wrote on last edited by
            #15

            The "fix for this":http://codereview.qt-project.org/#change,16794 has been merged into Qt5 now. Next up I will cherry pick it for Qt 4.8 later today.

            Nokia Certified Qt Specialist
            Interested in hearing about Qt related work

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #16

              Was Mac giving you troubles? ;-)

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                ZapB
                wrote on last edited by
                #17

                Yeah. The way that APIENTRY macro is brought into play is slightly different in Qt5 and I never tried building it on Mac myself before my first attempt. My bad as I do actually have a MacBook now.

                /me must try harder ;-)

                Nokia Certified Qt Specialist
                Interested in hearing about Qt related work

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mightcouldb1
                  wrote on last edited by
                  #18

                  Hi ZapB,
                  I am experiencing similar problems when trying to use the 3.2 core profile and GLSL 1.5 on Mac OSX Lion. How can I obtain the fix that you posted above(http://codereview.qt-project.org/#change,16794)? Is this Windows specific?

                  Will I have to wait for the release of Qt 5 or a patch for 4.8?

                  Thanks in advance,
                  Jason

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    ZapB
                    wrote on last edited by
                    #19

                    Hi Jason,

                    that particular fix was to fix a stack corruption on Windows. My next task is to fix the OpenGL context creation code for Mac and Windows to actually allow use of a Core profile context - it works fine on Linux. I'll post back here when I have something usable but it may take me a few days as I am away on a course most of this week.

                    Nokia Certified Qt Specialist
                    Interested in hearing about Qt related work

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      shucre
                      wrote on last edited by
                      #20

                      Hi ZapB,

                      Are we getting any closed to this fix (use of a Core profile context in Mac) or has it been postponed further?

                      Thanks in advance,
                      Shucre

                      1 Reply Last reply
                      0
                      • Z Offline
                        Z Offline
                        ZapB
                        wrote on last edited by
                        #21

                        It is fixed in Qt5 already (see https://codereview.qt-project.org/#change,22653). I've not had time to backport to 4.8.x yet. Still lots of work that could be done to improve using Core profile GL with Qt though.

                        Nokia Certified Qt Specialist
                        Interested in hearing about Qt related work

                        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