mesa/st: Add new data to mesa_glinterop

* Version 3 of mesa_glinterop_device_info
* Export device uuid
* Version 2 of mesa_glinterop_export_out
* Export texture sizes
* Export whandle.modifier
* Export whandle.stride
* Add PIPE_HANDLE_USAGE_EXPLICIT_FLUSH in interop_export_objects

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
This commit is contained in:
Antonio Gomes
2023-04-22 17:00:56 -03:00
committed by Marge Bot
parent d52f35fa1a
commit 663cef26d0
2 changed files with 55 additions and 9 deletions

View File

@@ -101,7 +101,9 @@ enum {
MESA_GLINTEROP_ACCESS_WRITE_ONLY
};
#define MESA_GLINTEROP_DEVICE_INFO_VERSION 2
#define MESA_GLINTEROP_DEVICE_INFO_VERSION 3
#define UUID_SIZE 16
/**
* Device information returned by Mesa.
@@ -139,6 +141,10 @@ struct mesa_glinterop_device_info {
void *driver_data;
/* Structure version 2 ends here. */
char device_uuid[UUID_SIZE];
/* Structure version 3 ends here. */
};
#define MESA_GLINTEROP_EXPORT_IN_VERSION 1
@@ -206,7 +212,7 @@ struct mesa_glinterop_export_in {
/* Structure version 1 ends here. */
};
#define MESA_GLINTEROP_EXPORT_OUT_VERSION 1
#define MESA_GLINTEROP_EXPORT_OUT_VERSION 2
/**
* Outputs of Mesa interop export functions.
@@ -266,6 +272,18 @@ struct mesa_glinterop_export_out {
/* The number of bytes written to out_driver_data. */
uint32_t out_driver_data_written;
/* Structure version 1 ends here. */
/* Structure version 2 starts here. */
/* Texture sizes. If the object is not a texture, default parameters will
* be returned.
*/
uint32_t width;
uint32_t height;
uint32_t depth;
uint32_t stride;
/* the modifier to use when reimporting the fd */
uint64_t modifier;
/* Structure version 2 ends here. */
};
@@ -339,13 +357,13 @@ wglMesaGLInteropExportObject(HDC dpy, HGLRC context,
/**
* Prepare OpenGL resources for being accessed by OpenCL.
*
*
* \param dpy GLX display
* \param context GLX context
* \param count number of resources
* \param resources resources to flush
* \param sync optional GLsync to map to CL event
*
*
* \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
*/
int