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

Missing events when using Vulkan (ash) #2127

Closed
lwjglgamedev opened this issue Jan 3, 2022 · 3 comments
Closed

Missing events when using Vulkan (ash) #2127

lwjglgamedev opened this issue Jan 3, 2022 · 3 comments
Labels
DS - windows F - question There's no such thing as a stupid one

Comments

@lwjglgamedev
Copy link

I am doing some tests with Vulkan using the ash library and winit. When running the examples provided by ash, I've noticed that when changing the presentation mode of the swap chain from MAILBOX to FIFO, to limit the frames to the scan rate, it seems that the window looses events. In this situation, it is even difficult or impossible to close it or to drag it. I have raised this issue first in the ash project but their response is that ash library is not involved at all in handling window events and that it may be related to DXGI’s internals.

I’m currently using Windows 11, you can reproduce the problem by using ash triangle example. If you clone the repository, you just need to change the file: https://github.com/MaikKlein/ash/blob/master/examples/src/lib.rs, chaning the value in line 362, from MAILBOX to FIFO.

Any ideas?

@msiglreith
Copy link
Member

Hi, I guess the WSI is effectively blocking the event loop in the FIFO case. The example code unconditionally renders on each incoming event (https://github.com/MaikKlein/ash/blob/master/examples/src/lib.rs#L188) which probably causes the present queue running out of available images faster than desired. Only updating on a MainEventsCleared or RedrawRequested event should alleviate this.

@msiglreith msiglreith added DS - windows F - question There's no such thing as a stupid one labels Jan 3, 2022
@msiglreith
Copy link
Member

(discussion in the ash repo for reference: ash-rs/ash#541)

@lwjglgamedev
Copy link
Author

Thanks for the response, I can confirm that rendering only upon MainEventsCleared solves the problem. My guess is that in FIFO mode, the event loop is blocked at some periods, to sync with scan rate, and this provokes the events to be lost. This does not happen in MAILBOX mode (altought many more render calls ara achieved), sine there is no blocking. I will close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DS - windows F - question There's no such thing as a stupid one
Development

No branches or pull requests

2 participants