Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

White background on the first frame [Windows] #2263

Closed
ekzee opened this issue Jul 16, 2023 · 2 comments
Closed

White background on the first frame [Windows] #2263

ekzee opened this issue Jul 16, 2023 · 2 comments

Comments

@ekzee
Copy link

ekzee commented Jul 16, 2023

  • Version of vulkano: 0.33.0
  • OS: Windows
  • GPU (the selected PhysicalDevice): NVIDIA GeForce RTX 2080 SUPER
  • Can reproduce in triangle_v1.3

Issue

Hello, there is a minor issue which were bothering me for quite a while. On Windows, when I start my app, background of the first frame is white, then it changes to clearColor. I have the very default winit EventLoop setup (and the issue is reproducible in triangle example). According to this issue it seems that this happens on windows when it didn't receive anything to draw, but Im quite puzzled where else should I put my render call besides Event::RedrawEventsCleared to fix that.

@Rua
Copy link
Contributor

Rua commented Jul 16, 2023

This happens because the window is visible before anything draws to the window. The window isn't filled with contents until you present the swapchain image for the first time. Before that, it's anyone's guess what it contains. It may be possible to hide the window until after the swapchain has been presented, but that may also mess with the swapchain in other ways. I think the best option is to just accept this as normal Windows behaviour.

@ekzee
Copy link
Author

ekzee commented Jul 16, 2023

I just tried setting window invisible in the WindowBuilder and then calling window.set_visible(true); after presenting swapchaing. Everything works just fine and annoying white flash is gone, thank you =)
But I will keep in mind your note about this possibly messing with the swapchain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants