OpenGL 3.2 core profile, QT 4.8 RC1 not working on Windows and Mac
-
wrote on 15 Nov 2011, 16:07 last edited by
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.
-
wrote on 14 Jan 2012, 15:11 last edited by
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.
-
wrote on 16 Feb 2012, 00:01 last edited by
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).
-
wrote on 16 Feb 2012, 01:59 last edited by
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!
-
wrote on 28 Feb 2012, 08:20 last edited by
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.
-
wrote on 28 Feb 2012, 09:08 last edited by
Was Mac giving you troubles? ;-)
-
wrote on 28 Feb 2012, 09:13 last edited by
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 ;-)
-
wrote on 5 Mar 2012, 05:04 last edited by
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 -
wrote on 5 Mar 2012, 08:39 last edited by
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.
-
wrote on 28 Apr 2012, 00:56 last edited by
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 -
wrote on 28 Apr 2012, 15:11 last edited by
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.