Use wl_display_roundtrip instead of wl_display_dispatch
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glmark2 |
Fix Committed
|
Undecided
|
Rafal Mielniczuk |
Bug Description
In native-
In NativeStateWayl
In the wayland documentation, it says this function dispatches the event queue and block if there is no event.
With the current Mesa egl implementation eglSwapInterval(0) doesn't work, and everything is as if it was eglSwapInterval(1):
When commiting the buffer, egl put a listener to know when the frame is drawn (when the frame is drawn an event is sent).
I was testing an experimental implementation of eglSwapInterval(0), and glmark2 was blocked until I press keyboard or other things (ie send events). This is because eglSwapBuffers doesn't put any listener on the frame in this case, and then there is no pending event.
Commiting a buffer is not considered an event but a request, that is why wl_display_dispatch is not adapted.
Instead what you want is wl_display_
EDIT: krh told me that wl_display_flush would be better than wl_display_
Related branches
- Alexandros Frantzis: Approve
-
Diff: 11 lines (+1/-1)1 file modifiedsrc/native-state-wayland.cpp (+1/-1)
description: | updated |
description: | updated |
Changed in glmark2: | |
status: | New → Fix Committed |
assignee: | nobody → Rafal Mielniczuk (kruk87) |
I've learned that wl_display_dispatch implicitly flushes requests, so my comment about it was bad.
The only problem is that it waits at least one event to come.
Instead wl_display_ roundtrip is similar to wl_display_ dispatch, but use a sync request to receive an event and prevent blocking.