summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJesse Natalie <jenatali@microsoft.com>2022-10-21 12:03:36 -0700
committerMarge Bot <emma+marge@anholt.net>2022-11-02 18:11:41 +0000
commit652d09d6ed91bb104040f7f49a5697106e88307d (patch)
tree299147bbccf08c5899bb0211d8d87fc4568832e6 /include
parentf343bd090d56529de25bc4865b4a963828d707c2 (diff)
downloadmesa-652d09d6ed91bb104040f7f49a5697106e88307d.tar.gz
include: Add WGL version of GL interop extensions
Reviewed-by: Adam Jackson <ajax@redhat.com> Acked-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>
Diffstat (limited to 'include')
-rw-r--r--include/GL/mesa_glinterop.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/GL/mesa_glinterop.h b/include/GL/mesa_glinterop.h
index 45fda93ca24..e0826b8f7ee 100644
--- a/include/GL/mesa_glinterop.h
+++ b/include/GL/mesa_glinterop.h
@@ -69,6 +69,14 @@ typedef void *EGLDisplay;
typedef void *EGLContext;
#endif
+#ifndef _WINDEF_
+struct HDC__;
+typedef struct HDC__ *HDC;
+struct HGLRC__;
+typedef struct HGLRC__ *HGLRC;
+typedef void *HANDLE;
+#endif
+
/** Returned error codes. */
enum {
MESA_GLINTEROP_SUCCESS = 0,
@@ -199,6 +207,7 @@ struct mesa_glinterop_export_out {
/* NOTE: Do not use the MESA_GLINTEROP_EXPORT_OUT_VERSION macro */
uint32_t version;
+#ifndef _WIN32
/* The DMABUF handle. It must be closed by the caller using the POSIX
* close() function when it's not needed anymore. Mesa is not responsible
* for closing the handle.
@@ -208,6 +217,12 @@ struct mesa_glinterop_export_out {
* DMABUF handles within the process.
*/
int dmabuf_fd;
+#else
+ /* Same concept as a DMABUF, but for Windows/WDDM. It must be closed by
+ * the caller using CloseHandle() when it's not needed anymore.
+ */
+ HANDLE win32_handle;
+#endif
/* The mutable OpenGL internal format specified by glTextureView or
* glTexBuffer. If the object is not one of those, the original internal
@@ -264,6 +279,14 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
/**
+* Same as MesaGLInteropGLXQueryDeviceInfo except that it accepts HDC
+* and HGLRC.
+*/
+int
+wglMesaGLInteropQueryDeviceInfo(HDC dpy, HGLRC context,
+ struct mesa_glinterop_device_info *out);
+
+/**
* Create and return a DMABUF handle corresponding to the given OpenGL
* object, and return other parameters about the OpenGL object.
*
@@ -290,16 +313,31 @@ MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext context,
struct mesa_glinterop_export_out *out);
+/**
+* Same as MesaGLInteropGLXExportObject except that it accepts
+* HDC and HGLRC.
+*/
+int
+wglMesaGLInteropExportObject(HDC dpy, HGLRC context,
+ struct mesa_glinterop_export_in *in,
+ struct mesa_glinterop_export_out *out);
+
+
typedef int (PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(struct _XDisplay *dpy, struct __GLXcontextRec *context,
struct mesa_glinterop_device_info *out);
typedef int (PFNMESAGLINTEROPEGLQUERYDEVICEINFOPROC)(EGLDisplay dpy, EGLContext context,
struct mesa_glinterop_device_info *out);
+typedef int (PFNWGLMESAGLINTEROPQUERYDEVICEINFOPROC)(HDC dpy, HGLRC context,
+ struct mesa_glinterop_device_info *out);
typedef int (PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(struct _XDisplay *dpy, struct __GLXcontextRec *context,
struct mesa_glinterop_export_in *in,
struct mesa_glinterop_export_out *out);
typedef int (PFNMESAGLINTEROPEGLEXPORTOBJECTPROC)(EGLDisplay dpy, EGLContext context,
struct mesa_glinterop_export_in *in,
struct mesa_glinterop_export_out *out);
+typedef int (PFNWGLMESAGLINTEROPEXPORTOBJECTPROC)(HDC dpy, HGLRC context,
+ struct mesa_glinterop_export_in *in,
+ struct mesa_glinterop_export_out *out);
#ifdef __cplusplus
}