glx: Provide glvnd wrapper for glXSwapIntervalEXT

When using glvnd, this function needs to be exposed through
getDispatchAddress or libglvnd will not find it.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Fixes: 60ebeb4608 "glx: Implement GLX_EXT_swap_control for DRI2 and DRI3"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8621>
(cherry picked from commit d548d781ee)
This commit is contained in:
Keith Packard 2021-01-21 12:19:12 -08:00 committed by Dylan Baker
parent 7a4e04f3f8
commit f59b95c7b3
3 changed files with 22 additions and 1 deletions

View file

@ -427,7 +427,7 @@
"description": "glx: Provide glvnd wrapper for glXSwapIntervalEXT",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "60ebeb4608a871ba89ba081c1c6e7ebdd5efec9a"
},

View file

@ -87,6 +87,7 @@ const char * const __glXDispatchTableStrings[DI_LAST_INDEX] = {
__ATTRIB(SelectEventSGIX),
// glXSwapBuffers implemented by libglvnd
__ATTRIB(SwapBuffersMscOML),
__ATTRIB(SwapIntervalEXT),
__ATTRIB(SwapIntervalMESA),
__ATTRIB(SwapIntervalSGI),
// glXUseXFont implemented by libglvnd
@ -893,6 +894,24 @@ static int dispatch_SwapIntervalMESA(unsigned int interval)
static void dispatch_SwapIntervalEXT(Display *dpy, GLXDrawable drawable, int interval)
{
PFNGLXSWAPINTERVALEXTPROC pSwapIntervalEXT;
__GLXvendorInfo *dd;
dd = GetDispatchFromDrawable(dpy, drawable);
if (dd == NULL)
return;
__FETCH_FUNCTION_PTR(SwapIntervalEXT);
if (pSwapIntervalEXT == NULL)
return;
pSwapIntervalEXT(dpy, drawable, interval);
}
static Bool dispatch_WaitForMscOML(Display *dpy, GLXDrawable drawable,
int64_t target_msc, int64_t divisor,
int64_t remainder, int64_t *ust,
@ -974,6 +993,7 @@ const void * const __glXDispatchFunctions[DI_LAST_INDEX + 1] = {
__ATTRIB(ReleaseTexImageEXT),
__ATTRIB(SelectEventSGIX),
__ATTRIB(SwapBuffersMscOML),
__ATTRIB(SwapIntervalEXT),
__ATTRIB(SwapIntervalMESA),
__ATTRIB(SwapIntervalSGI),
__ATTRIB(WaitForMscOML),

View file

@ -79,6 +79,7 @@ typedef enum __GLXdispatchIndex {
DI_SelectEventSGIX,
// SwapBuffers implemented by libglvnd
DI_SwapBuffersMscOML,
DI_SwapIntervalEXT,
DI_SwapIntervalMESA,
DI_SwapIntervalSGI,
// UseXFont implemented by libglvnd