GLFW: Occasional white window on launch, no errors, app still running

For years our game launched with no problems. The window would open (blank white), turn black after a fraction of a second, and then the opening screen would display.

Since a Windows update earlier this year, the game will - seemingly at random - occasionally ‘stick’ on the blank white window, permanently. Even recreating the window makes no difference.

It reports no errors or GL errors (a couple of warnings from shader compilation that are there regardless of whether it works or not), and continues to run and render quite happily. You just can’t see anything.

I’ve single-stepped through the GLFW initialisation and there are no differences that I can find between a successful and unsuccessful launch. Everything’s initialised correctly, the window and wgl data is identical.

I’ve broken into and single-stepped through the screen swap and presentation - no errors, everything looks completely above board and identical to successful launches.

I’ve used ‘apitrace’ to capture successful and unsuccessful launches. The traces are identical.

I’ve used qapitrace to replay the (identical) traces. Both render perfectly most of the time, and both will, at random, sometimes result in a blank grey window instead, as though qapitrace is falling foul of the same bug.

I am, frankly, at a complete loss. Players are reporting this bug now and I don’t have a clue what to do to fix it.

Has anyone else encountered this?

EDIT: I’ve found a simplest repro case:

  1. Set up the various glfwWindowHints
  2. Call glfwCreateWindow
  3. Call glfwSwapBuffers

Most of the time, this leaves me looking at a black window (‘swap buffers’ has correctly presented the empty render buffer). If this happens, the game will then work just fine.

Sometimes, those three steps leave me looking at a white window. Swap buffers has done nothing. If this happens, the game will run okay but the window will remain blank and white no matter how often swapbuffers is called.

Which GPU, GPU graphics driver version, and variant of Windows (7,8.1, 10, etc.)?

My first though is to try upgrading or downgrading your graphics driver to see if that makes any difference.

It might also help you to localize where your application is freezing up. For testing only, sprinkle glFinish() calls around to block the CPU until the actions previously requested (in the GL call stream at least) have completed.

You could also try enabling debug output from your GL implementation. It could be that there is a problem with your usage that’s been detected by the GL driver, and it’s just waiting to tell you what that is. See Debug Output.

Hard to narrow it down. Here we have Intel HD Graphics 4600’s and Windows 10. Reports have come in from people with AMD cards (and Windows 10)

It started after a windows update. Whether or not that included a driver update I don’t know.

My first though is to try upgrading or downgrading your graphics driver to see if that makes any difference.

Again, Windows 10 seems to be the only common denominator so far.

It might also help you to localize where your application is freezing up. For testing only, sprinkle glFinish() calls around to block the CPU until the actions previously requested (in the GL call stream at least) have completed.

As I explained, the application is not freezing up. It’s running just fine and rendering/presenting every frame with no errors - you just can’t see anything. It’s as though the ‘swap’ isn’t happening, or isn’t connected to the window somehow, but I’ve stepped through it line by line and there are no differences between when it’s working and when it’s not.

You could also try enabling debug output from your GL implementation. It could be that there is a problem with your usage that’s been detected by the GL driver, and it’s just waiting to tell you what that is. See Debug Output.

As I said, I’ve used APITRACE to capture the boot and first few seconds of the game. When I use qapitrace to replay those traces, it works perfectly most of the time (even traces captured from a ‘white screen’ launch work perfectly). However, if I replay the same trace several times within qapitrace it will sometimes, seemingly at random, display a blank window instead. There are no GL errors either way (and apitrace enables GL_DEBUG_OUTPUT). Whatever the bug is, qapitrace is suffering from it too.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.