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

Window resizing lags in v0.9.2 #69

Closed
KSchala opened this issue Jan 24, 2024 · 3 comments · Fixed by #70
Closed

Window resizing lags in v0.9.2 #69

KSchala opened this issue Jan 24, 2024 · 3 comments · Fixed by #70
Assignees
Labels
bug Something isn't working

Comments

@KSchala
Copy link

KSchala commented Jan 24, 2024

I wanted to say thank you first. After dealing with Ash and Vulkano, Screen-13 is just pure fun to experiment with.
However, there is an issue when resizing the window in the latest version that results in freezes.

Just tried the triangle example and it happens here also. In 0.9.1 i had no such behavior.

OS: Windows 11

@attackgoat
Copy link
Owner

attackgoat commented Jan 25, 2024

One of the things updated in 0.9.2 was the gpu-allocator crate, I suspect but have not yet confirmed that this may be related to the issue. The main issue is that the HashPool and LazyPool types have no way to manage memory and so allocating new images to support a new swapchain size as you resize creates lots of new resources that are not reused or freed - they remain in the pool for any other request to use.

I've been putting off this work because everything works fine for regular games and programs which request very similar resources each frame. Resize breaks this. Also a lot of the toys I've been making are resolution independent and don't have this issue during resize.

I think the Pool types work well because they're much more efficient than creating new resources each time one is needed, but there should be some new API that manages the total supply of resources within given limits. Right now only an individual bucket of resources (of the same dimensions/settings) is kept to a reasonable number.

I will create a PR soon with some ideas, and I am glad you enjoy Screen-13!

@attackgoat attackgoat added the bug Something isn't working label Jan 25, 2024
@attackgoat attackgoat self-assigned this Jan 25, 2024
@attackgoat attackgoat linked a pull request Jan 28, 2024 that will close this issue
5 tasks
@attackgoat
Copy link
Owner

I wasn't able to repro on Ubuntu but I finally got to a Windows machine and it repro'd right away. The issue is that Swapchain::destroy is hanging for about 500ms. The previous version does not exhibit the issue.

I used OpTick profiler to debug the issue:

cargo run --example triangle --features profile-with-optick

Once I upgraded the Nvidia driver from 546.33 -> 551.23 the issue went away.

If you are on Nvidia hardware is this something you can try?

@KSchala
Copy link
Author

KSchala commented Jan 29, 2024

Oh damn, should have come up with updating my drivers myself..
Now its working fine.

Sorry for wasting your time and thank you very much!

@KSchala KSchala closed this as completed Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants