diff options
Diffstat (limited to 'src/glx/glxcmds.c')
-rw-r--r-- | src/glx/glxcmds.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 93e8db5a367..63f492128bc 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -54,6 +54,7 @@ #include <X11/Xlib-xcb.h> #include <xcb/xcb.h> #include <xcb/glx.h> +#include "GL/mesa_glinterop.h" static const char __glXGLXClientVendorName[] = "Mesa Project and SGI"; static const char __glXGLXClientVersion[] = "1.4"; @@ -2691,3 +2692,56 @@ __glXGetUST(int64_t * ust) } } #endif /* GLX_DIRECT_RENDERING */ + +#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) + +GLAPI int GLAPIENTRY +MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context, + mesa_glinterop_device_info *out) +{ + struct glx_context *gc = (struct glx_context*)context; + int ret; + + __glXLock(); + + if (!gc || gc->xid == None || !gc->isDirect) { + __glXUnlock(); + return MESA_GLINTEROP_INVALID_CONTEXT; + } + + if (!gc->vtable->interop_query_device_info) { + __glXUnlock(); + return MESA_GLINTEROP_UNSUPPORTED; + } + + ret = gc->vtable->interop_query_device_info(gc, out); + __glXUnlock(); + return ret; +} + +GLAPI int GLAPIENTRY +MesaGLInteropGLXExportObject(Display *dpy, GLXContext context, + const mesa_glinterop_export_in *in, + mesa_glinterop_export_out *out) +{ + struct glx_context *gc = (struct glx_context*)context; + int ret; + + __glXLock(); + + if (!gc || gc->xid == None || !gc->isDirect) { + __glXUnlock(); + return MESA_GLINTEROP_INVALID_CONTEXT; + } + + if (!gc->vtable->interop_export_object) { + __glXUnlock(); + return MESA_GLINTEROP_UNSUPPORTED; + } + + ret = gc->vtable->interop_export_object(gc, in, out); + __glXUnlock(); + return ret; +} + +#endif /* defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) */ |