glx: Fix the GLX_EXT_swap_control_tear drawable attributes
GLX_SWAP_INTERVAL_EXT is always positive, GLX_LATE_SWAPS_TEAR_EXT is how
you tell whether the drawable is set to do it. This aligns us with the
spec and NVIDIA's GLX.
Closes: mesa/mesa#10193
Fixes: 5e9e457383 glx/dri3: Implement GLX_EXT_swap_control_tear
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31655>
This commit is contained in:
@@ -296,14 +296,13 @@ __glXGetDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
||||
|
||||
if (pdraw) {
|
||||
if (attribute == GLX_SWAP_INTERVAL_EXT) {
|
||||
*value = pdraw->psc->driScreen.getSwapInterval(pdraw);
|
||||
*value = abs(pdraw->psc->driScreen.getSwapInterval(pdraw));
|
||||
return 1;
|
||||
} else if (attribute == GLX_MAX_SWAP_INTERVAL_EXT) {
|
||||
*value = pdraw->psc->driScreen.maxSwapInterval;
|
||||
return 1;
|
||||
} else if (attribute == GLX_LATE_SWAPS_TEAR_EXT) {
|
||||
*value = __glXExtensionBitIsEnabled(pdraw->psc,
|
||||
EXT_swap_control_tear_bit);
|
||||
*value = pdraw->psc->driScreen.getSwapInterval(pdraw) < 0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user