-
Notifications
You must be signed in to change notification settings - Fork 108
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
EGL_KHR_platform_wayland: Clarify requirements of eglSwapBuffers #205
base: main
Are you sure you want to change the base?
Conversation
@@ -93,6 +94,16 @@ New Behavior | |||
until the next buffer swap. The rationale behind this behavior is to keep | |||
operations result accurate until the next swap. | |||
|
|||
During the call to eglSwapBuffers wl_surface.attach will be requested with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we maybe clarify that the EGL implementation is the one who will do these requests instead of just saying they "will be requested"? It seems like that's the way things like this are worded in some other extensions for clarity.
During the call to eglSwapBuffers wl_surface.attach will be requested with | |
During the call to eglSwapBuffers wl_surface.attach will be requested by the EGL implementation with |
Not sure if we also need to call out things like explicit sync points being sent by the implementation as part of this commit? I guess what you have right now just specifies the minimum set of requests the implementation will do, so that could be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems hard both to enumerate all the state ever needed and to write general language that implies the right amount of state.
Maybe for explicit sync:
"if the EGL implementation associated a wp_linux_drm_syncobj_surface_v1 object with the surface, an acquire and a release point will be associated with the surface prior to the commit as well."
For others state the implementation might need to set as part of a commit, hopefully it makes more sense to call it out in separate extensions? E.g., as an interaction with this extension in a present timing extension, an HDR extension, etc., or in the other direction for existing EGL extensions that necessitate additional wayland surface state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworded things a bit while still trying to make it more explicit, because adding "by the EGL implementation" to every "requested" would have been a bit much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't add anything about explicit sync there, as it's not strictly needed, but could be added too I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"if the EGL implementation associated a wp_linux_drm_syncobj_surface_v1 object with the surface, an acquire and a release point will be associated with the surface prior to the commit as well."
Added this as well, thanks.
Context on the motivation for this: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/423 |
During the call to eglSwapBuffers wl_surface.attach will be requested with | ||
the new front buffer, a full surface damage is requested via | ||
wl_surface.damage or wl_surface.damage_buffer, and a wl_surface.commit will | ||
be requested to commit the new state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to call out that this must be synchronous within eglSwapBuffers
and cannot be deferred to a thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me this language already implies that, but you could say something like "Before the call to eglSwapBuffers() returns" or similar, rather than "During the call to." It could still happen in another thread, but has to happen before the call ends from the calling thread's perspective, rather than some mangled interpretation of the call's duration from the driver's point of view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that better? I left out mentioning threads, because I guess it's still technically possible to offload anything to a thread, as long as the thread calling eglSwapBuffers is blocked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. Thanks!
0980dca
to
cc37425
Compare
cc37425
to
1e47686
Compare
The EGL implementation attaching the front buffer, posting damage, and committing during the call to eglSwapBuffers(WithDamage)() is a well established requirement that EGL Wayland clients currently rely upon, thus should be explicitly documented.
1e47686
to
fc1b211
Compare
This version looks good to me. |
The EGL implementation attaching the front buffer, posting damage, and committing during the call to eglSwapBuffers(WithDamage)() is a well established requirement that EGL Wayland clients currently rely upon, thus should be explicitly documented.
I noticed EGL_EXT_platform_wayland already existing, but EGL_KHR_platform_wayland seems to be the one most recently updated. Should this perhaps be targeting that, and with the changes to the KHR variant being ported over?