From f35c8b4dbf15dbdfaedc5fb107d808377b15a6e9 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Fri, 21 Oct 2022 14:52:41 -0700 Subject: [PATCH] egl/wgl: Implement interop methods Reviewed-by: Adam Jackson Acked-by: Karol Herbst Part-of: --- src/egl/drivers/wgl/egl_wgl.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/egl/drivers/wgl/egl_wgl.c b/src/egl/drivers/wgl/egl_wgl.c index 3e1fe23c010..d93c58cb773 100644 --- a/src/egl/drivers/wgl/egl_wgl.c +++ b/src/egl/drivers/wgl/egl_wgl.c @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -45,6 +46,8 @@ #include #include "util/u_call_once.h" +#include + static EGLBoolean wgl_match_config(const _EGLConfig *conf, const _EGLConfig *criteria) { @@ -1161,6 +1164,32 @@ wgl_query_driver_config(_EGLDisplay *disp) return stw_get_config_xml(); } +static int +wgl_interop_query_device_info(_EGLDisplay *disp, _EGLContext *ctx, + struct mesa_glinterop_device_info *out) +{ + struct wgl_egl_context *wgl_ctx = wgl_egl_context(ctx); + return stw_interop_query_device_info(wgl_ctx->ctx, out); +} + +static int +wgl_interop_export_object(_EGLDisplay *disp, _EGLContext *ctx, + struct mesa_glinterop_export_in *in, + struct mesa_glinterop_export_out *out) +{ + struct wgl_egl_context *wgl_ctx = wgl_egl_context(ctx); + return stw_interop_export_object(wgl_ctx->ctx, in, out); +} + +static int +wgl_interop_flush_objects(_EGLDisplay *disp, _EGLContext *ctx, + unsigned count, struct mesa_glinterop_export_in *objects, + GLsync *sync) +{ + struct wgl_egl_context *wgl_ctx = wgl_egl_context(ctx); + return stw_interop_flush_objects(wgl_ctx->ctx, count, objects, sync); +} + struct _egl_driver _eglDriver = { .Initialize = wgl_initialize, .Terminate = wgl_terminate, @@ -1187,5 +1216,8 @@ struct _egl_driver _eglDriver = { .SignalSyncKHR = wgl_signal_sync_khr, .QueryDriverName = wgl_query_driver_name, .QueryDriverConfig = wgl_query_driver_config, + .GLInteropQueryDeviceInfo = wgl_interop_query_device_info, + .GLInteropExportObject = wgl_interop_export_object, + .GLInteropFlushObjects = wgl_interop_flush_objects, };