dri: Flush the context after flush_resource when creating shareable image

This makes sure that we'll be done with any pending preparations before
the actual export of the resource.

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13154>
This commit is contained in:
Sviatoslav Peleshko 2024-03-13 14:32:41 +02:00 committed by Marge Bot
parent 27d35588f5
commit a330ecc48a

View file

@ -346,8 +346,10 @@ dri2_create_image_from_renderbuffer2(__DRIcontext *context,
* it's in a shareable state. Do this now while we still have the access to
* the context.
*/
if (dri2_get_mapping_by_format(img->dri_format))
if (dri2_get_mapping_by_format(img->dri_format)) {
p_ctx->flush_resource(p_ctx, tex);
st_context_flush(st, 0, NULL, NULL, NULL);
}
ctx->Shared->HasExternallySharedImages = true;
*error = __DRI_IMAGE_ERROR_SUCCESS;
@ -455,8 +457,10 @@ dri2_create_from_texture(__DRIcontext *context, int target, unsigned texture,
* it's in a shareable state. Do this now while we still have the access to
* the context.
*/
if (dri2_get_mapping_by_format(img->dri_format))
if (dri2_get_mapping_by_format(img->dri_format)) {
p_ctx->flush_resource(p_ctx, glimg->pt);
st_context_flush(st, 0, NULL, NULL, NULL);
}
ctx->Shared->HasExternallySharedImages = true;
*error = __DRI_IMAGE_ERROR_SUCCESS;