#Detecting when the GPU is ready (avoiding the white screen on app startup)

9 messages · Page 1 of 1 (latest)

unkempt oar
#

When my app starts, it basically flashes white. In the window_settings example, it's mentioned that this is because the "window shows up before the GPU is ready to render the app". The example gets around this by making the window visible after frame 3, which I think is related to the default PresentMode that windows use (Fifo) utilises a "First-In-First-Out queue approximately 3 frames long", although this is just a guess.

Is there a more certain way of avoiding the white screen? 🤔

somber pulsar
#

It's not related to fifo, there's just some strange stuff going on in the first few frames. They take a long time as well.

No better way that I know of, and if a better one is found it will make it into Bevy proper :)

#

I don't know of any downsides to waiting 3 frames to show the window, so I'd use that

unkempt oar
#

on a related note, in the window_settings example, the 3rd frame check (when the window becomes visible) is added to the Update stage (schedule?), is it possible to make it run once on the 3rd frame with a condition?

#

i feel like its a waste to have it running every frame, but maybe its negligible (in which case it doesnt matter) 🤷‍♂️

somber pulsar
#

It probably doesn't matter much, but it is good practice:

.run_if(|frames: Res<FrameCount>| frames.0 == 3)
vivid tundra
#

I wrote two examples for this, the second one #general message