C++ - Enabling OpenGL Triple Buffering + Vsync in AMD CCC Breaks Our App - Stack Overflow
C++ - Enabling OpenGL Triple Buffering + Vsync in AMD CCC Breaks Our App - Stack Overflow
We've got a desktop Windows app written in C++ which uses an OpenGL rendered view.
On some AMD cards, if you open Catalyst Control Center and force Triple Buffering and V-sync on, it
1
breaks our app: nothing renders at all, it's just a grey screen (on some other driver versions, it crashes
on creating the context instead). Turning off either triple buffering or V-sync restores it to normal.
We use wglSwapIntervalEXT to enable V-syncing in our app. Thinking it might conflict, I removed the
code for it; no change.
Is this definitely a driver bug or is there anything different we have to do to handle triple buffering?
Share Improve this question Follow asked Jan 29, 2013 at 18:04
AshleysBrain
22.2k 15 90 125
I have run into this same issue in my own application and it's been maddening to track down. Here's the
additional information I can provide based upon a minimal application testing setup I built to replicate the
4 problem:
1) All of your calls to set the pixel format and create a GL RC will succeed. However, GLDebugger will
show that the RC does not actually acquire static buffers.
2) When you try to make the RC current, it will return false, and GetLastError() says there is an invalid
handle.
3) I can only replicate this problem in MFC. Is that what you're using? When I built a testbed application
using straight Win32 API, it works fine. There has to be an obscure interaction at play here..
I'm afraid my answer leans towards "Driver Bug", but point #4 shows a workaround -- rather than do
your GL window creation in OnCreate, try instead doing it as a one-off in OnInitialUpdate -- this so far is
working in test for me!
UPDATE: I've contacted AMD about this issue, and it turns out that this is a result of MFC creating the
window with zero width/height originally, then resizing. If in your PreCreate function assign nonzero
dimensions, everything works.
Hopefully this will be a good resource for everyone trying to figure out what's going on with this!
https://stackoverflow.com/questions/14589323/enabling-opengl-triple-buffering-vsync-in-amd-ccc-breaks-our-app?rq=3 1/2
4/7/24, 4:16 PM c++ - Enabling OpenGL triple buffering + vsync in AMD CCC breaks our app - Stack Overflow
Share Improve this answer Follow edited Mar 26, 2013 at 18:42 answered Mar 26, 2013 at 4:53
Stephen
166 2 5
Thanks for the workaround suggestion! I'll give it a go and see if it resolves anything for our users. (You were right
about us using MFC.) – AshleysBrain Mar 26, 2013 at 15:24
There's even better news: I previously had contacted AMD about this issue and they got back to me. Turns out with
triple buffering+vsynch on, your windows must have a non-zero size at creation. So in your PreCreateWindow
function, set cx and cy to 1. A better workaround :) – Stephen Mar 26, 2013 at 18:41
Lucky you! I never heard anything back from AMD despite trying to contact them multiple times. Thanks for the
extra info, will make sure both those workarounds are used! – AshleysBrain Mar 27, 2013 at 12:37
https://stackoverflow.com/questions/14589323/enabling-opengl-triple-buffering-vsync-in-amd-ccc-breaks-our-app?rq=3 2/2