Closed mahkoh closed 5 months ago
Changes seem reasonable, happy to take this as a PR.
Since I'm a wayland newbie, I needed to look up the docs for the wl_display_dispatch
and wl_display_dispatch_pending
functions, and they make sense with the explanation given, so I very much appreciate the details added.
My understanding is that wl_display_dispatch_pending
only dispatches "pending" events, whereas wl_display_dispatch
will also poll for events (blocking in the process) before dispatching events. Mesa no longer polling in acquire indeed is a departure in behavior, but an understandable one.
Here is the outer loop of vkcube-wayland:
As long as the demo is not paused, vkcube-wayland only invokes
wl_display_dispatch_pending
which will not read any data from the wayland socket. This has worked so far because the WSI would read from the wayland socket invkAcquireNextImageKHR
.However, in the next mesa release, and if the wayland compositor supports it, mesa will no longer read from the wayland socket in
vkAcquireNextImageKHR
. This will cause no messages (keyboard input, resize events, etc.) to be read and dispatched.I've used the following patch for testing, but you might come up with a more elegant solution: