diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 1c41f89454f..eb49ac5ea1b 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -929,7 +929,8 @@ static const struct glx_context_vtable dri2_context_vtable = { .wait_gl = dri2_wait_gl, .wait_x = dri2_wait_x, .interop_query_device_info = dri2_interop_query_device_info, - .interop_export_object = dri2_interop_export_object + .interop_export_object = dri2_interop_export_object, + .interop_flush_objects = dri2_interop_flush_objects }; static void diff --git a/src/glx/dri2_priv.h b/src/glx/dri2_priv.h index bea1ac0c9c1..e8f1b64b85e 100644 --- a/src/glx/dri2_priv.h +++ b/src/glx/dri2_priv.h @@ -77,6 +77,11 @@ dri2_interop_export_object(struct glx_context *ctx, struct mesa_glinterop_export_in *in, struct mesa_glinterop_export_out *out); +_X_HIDDEN int +dri2_interop_flush_objects(struct glx_context *ctx, + unsigned count, struct mesa_glinterop_export_in *objects, + GLsync *sync); + #ifdef __cplusplus } #endif diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index a8c20ce14bb..abec1ce6baf 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -710,7 +710,8 @@ static const struct glx_context_vtable dri3_context_vtable = { .wait_gl = dri3_wait_gl, .wait_x = dri3_wait_x, .interop_query_device_info = dri3_interop_query_device_info, - .interop_export_object = dri3_interop_export_object + .interop_export_object = dri3_interop_export_object, + .interop_flush_objects = dri3_interop_flush_objects }; /** dri3_bind_extensions diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h index 5b43f732ad5..09dcefd6115 100644 --- a/src/glx/dri3_priv.h +++ b/src/glx/dri3_priv.h @@ -138,3 +138,8 @@ _X_HIDDEN int dri3_interop_export_object(struct glx_context *ctx, struct mesa_glinterop_export_in *in, struct mesa_glinterop_export_out *out); + +_X_HIDDEN int +dri3_interop_flush_objects(struct glx_context *ctx, + unsigned count, struct mesa_glinterop_export_in *objects, + GLsync *sync); diff --git a/src/glx/dri_common_interop.c b/src/glx/dri_common_interop.c index 0952a85cae7..cce3776a35c 100644 --- a/src/glx/dri_common_interop.c +++ b/src/glx/dri_common_interop.c @@ -57,6 +57,19 @@ dri2_interop_export_object(struct glx_context *ctx, return psc->interop->export_object(ctx->driContext, in, out); } +_X_HIDDEN int +dri2_interop_flush_objects(struct glx_context *ctx, + unsigned count, struct mesa_glinterop_export_in *objects, + GLsync *sync) +{ + struct dri2_screen *psc = (struct dri2_screen*)ctx->psc; + + if (!psc->interop || psc->interop->base.version < 2) + return MESA_GLINTEROP_UNSUPPORTED; + + return psc->interop->flush_objects(ctx->driContext, count, objects, sync); +} + #if defined(HAVE_DRI3) _X_HIDDEN int @@ -84,5 +97,18 @@ dri3_interop_export_object(struct glx_context *ctx, return psc->interop->export_object(ctx->driContext, in, out); } +_X_HIDDEN int +dri3_interop_flush_objects(struct glx_context *ctx, + unsigned count, struct mesa_glinterop_export_in *objects, + GLsync *sync) +{ + struct dri3_screen *psc = (struct dri3_screen*)ctx->psc; + + if (!psc->interop || psc->interop->base.version < 2) + return MESA_GLINTEROP_UNSUPPORTED; + + return psc->interop->flush_objects(ctx->driContext, count, objects, sync); +} + #endif /* HAVE_DRI3 */ #endif /* defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) */ diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 7de7391ad01..1c4632dceb8 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -244,6 +244,9 @@ struct glx_context_vtable { int (*interop_export_object)(struct glx_context *ctx, struct mesa_glinterop_export_in *in, struct mesa_glinterop_export_out *out); + int (*interop_flush_objects)(struct glx_context *ctx, + unsigned count, struct mesa_glinterop_export_in *objects, + GLsync *sync); }; /**