-
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
RFC: EGL counterpart to GLX_EXT_swap_control_tear #113
base: main
Are you sure you want to change the base?
Conversation
I was looking at this same issue for ANGLE, where the Vulkan backend could use FIFO_RELAXED to implement the feature: https://bugs.chromium.org/p/angleproject/issues/detail?id=4257 Incidentally, the NVIDIA binary driver already accepts negative values for eglSwapInterval, so the extension is somewhat supported already despite not being advertised at all. |
Looks useful. IIUC, FIFO_RELAXED is the equivalent of I'm not sure how problematic that is though for applications. What if an application just uses the value of What if a new symbol like |
EGL Work Group ping'd for comment. |
As per the specification for eglSwapInterval, the NVIDIA EGL driver silently clamps negative values to EGL_MIN_SWAP_INTERVAL, which is 0. The feature described here is NOT supported. |
I agree that is a potential problem which will cause backwards compatibility issues. I think it probably wasn't a consideration for GLX because it only exposes a constant for MAX interval, not MIN. It seems to be that a better way to support this feature would be as a separate flag, rather than overloading the swap interval. But if there's a need to make this mirror the GLX extension, then perhaps a compromise is that it requires explicitly setting a new surface attribute to enable the feature, and then eglSwapInterval will accept negative values for that surface. |
Are we aware of any scenario where the max swap interval would not be possible as a negative swap interval? If not, the attribute might be enough, without having to worry for something like MIN_NEGATIVE_INTERVAL - having a new flag would be a bit fussy for us using SDL, for example, since we only have SDL_GL_SetSwapInterval available to us, so any new EGL functionality would have to be tacked onto the EGL backend for that call. |
In Mesa the "max" swap interval is just Internally Mesa uses the negative-interval convention since it's unambiguous and matched what GLX did. I don't have any particular need for the EGL API to do the same, and given the existing language about clamping to
SDL could still honor the negative-interval convention if it wanted, and Mesa would likely convert that to a negative interval internally, but anybody else that happened to be accidentally setting a negative interval would see no change. The next question would be whether you'd need to have |
An opt-in for eglSurfaceAttrib would be great for us. We do already have some backends where we set an error without even calling SwapInterval when interval < 0, so we could do the same for the EGL backend if the function returns EGL_FALSE (or EGL_BAD_ATTRIBUTE if it's an old setup). @ShabbyX might have a better idea of where to put |
In the Vulkan backend of ANGLE, we use swap interval to determine the swapchain's Given that FYI @null77 |
Just to be clear, when I said "For Mesa it's a property of the EGLDisplay not the EGLConfig", I was describing how the implementation works, not the object where the state is attached. The swap interval is a property of the surface. From the spec (emphasis mine):
That said, in trying to sketch out the spec language adding an EGLConfig attribute and documenting the interactions with the other clever-posting-semantics extensions, I'm not loving it. I'm considering making it only a surface attribute, with some language a la |
In case I wasn't clear before, that's what ANGLE prefers as well. |
89019ca
to
925b349
Compare
New revision adds the surface query, some extension interactions, and a few more open issues, and provisionally allocates an enum from Mesa's range. I'm hoping to have it wired up for Mesa later this week, see the Mesa merge request for updates on the code part. |
When we switched to using SPDX identifiers instead of explicit Apache 2.0 text, the resulting generated headers ended up with a nested /* inside the license comment.
925b349
to
f1f1c15
Compare
Updated (atop #114), now with updated XML and headers. |
Need a few MESA supporters to review. |
Working on a Wayland protocol to allow clients to request asynchronous buffer swaps revealed the problem that EGL does not have a way to differentiate between This extension seems to provide the desired functionality; interpreting the text literally, a swap interval of 0 means that all frames are late and thus should always tear. Should that maybe be stated explicitly in the extension text? |
Closes gitlab KhronosGroup#113.
There's no EGL analogue to
GLX_EXT_swap_control_tear
, which seems like an easy oversight to fix.I don't have this quite wired up for Mesa yet, and there's some details to address. The GLX extensions let you name a drawable explicitly (meh) and also query the actually-set swap interval and whether tears can be requested. I'm not convinced that's useful for EGL, since you can't import an EGL surface the way you can a GLX drawable, but maybe we're orthogonality enthusiasts. Feedback welcome.