dri_interface: add interface for GL interop with other APIs (v2)
authorMarek Olšák <marek.olsak@amd.com>
Mon, 29 Feb 2016 22:19:18 +0000 (23:19 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 20 Apr 2016 10:18:47 +0000 (12:18 +0200)
v2: - use const

include/GL/internal/dri_interface.h

index 2b49a2941e19077a7d5f18dde7ed06be9de9cf64..84731a06ef24dc5b33ed8b03f3c7958d07f72c5a 100644 (file)
@@ -79,6 +79,7 @@ typedef struct __DRIdri2LoaderExtensionRec    __DRIdri2LoaderExtension;
 typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
 typedef struct __DRI2throttleExtensionRec      __DRI2throttleExtension;
 typedef struct __DRI2fenceExtensionRec          __DRI2fenceExtension;
+typedef struct __DRI2interopExtensionRec       __DRI2interopExtension;
 
 
 typedef struct __DRIimageLoaderExtensionRec     __DRIimageLoaderExtension;
@@ -392,6 +393,31 @@ struct __DRI2fenceExtensionRec {
 };
 
 
+/**
+ * Extension for API interop.
+ * See GL/mesa_glinterop.h.
+ */
+
+#define __DRI2_INTEROP "DRI2_Interop"
+#define __DRI2_INTEROP_VERSION 1
+
+typedef struct _mesa_glinterop_device_info mesa_glinterop_device_info;
+typedef struct _mesa_glinterop_export_in mesa_glinterop_export_in;
+typedef struct _mesa_glinterop_export_out mesa_glinterop_export_out;
+
+struct __DRI2interopExtensionRec {
+   __DRIextension base;
+
+   /** Same as MesaGLInterop*QueryDeviceInfo. */
+   int (*query_device_info)(__DRIcontext *ctx,
+                            mesa_glinterop_device_info *out);
+
+   /** Same as MesaGLInterop*ExportObject. */
+   int (*export_object)(__DRIcontext *ctx,
+                        const mesa_glinterop_export_in *in,
+                        mesa_glinterop_export_out *out);
+};
+
 /*@}*/
 
 /**