AshleysBrain
AshleysBrain

Reputation: 22621

Enabling OpenGL triple buffering + vsync in AMD CCC breaks our app

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 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?

Upvotes: 1

Views: 2312

Answers (1)

Stephen
Stephen

Reputation: 166

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

4) If I delay RC creation until after OnCreate, then things build fine.

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!

Upvotes: 4

Related Questions