From f98d47e0117e8eedd4a4244e2a7839be01f2227e Mon Sep 17 00:00:00 2001 From: Sidney Just Date: Fri, 29 Apr 2022 12:09:41 -0700 Subject: [PATCH] gallium: support for implementing EXT_external_objects_win32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Acked-by: Marek Olšák Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/include/pipe/p_defines.h | 1 + src/gallium/include/pipe/p_screen.h | 33 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 05bfab3ffc2..e6b4a711f32 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -1386,6 +1386,7 @@ enum pipe_perf_counter_data_type }; #define PIPE_UUID_SIZE 16 +#define PIPE_LUID_SIZE 8 #ifdef PIPE_OS_UNIX #define PIPE_MEMORY_FD diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 3beb08f7cf5..4e500d3d78d 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -403,6 +403,21 @@ struct pipe_screen { int (*fence_get_fd)(struct pipe_screen *screen, struct pipe_fence_handle *fence); + /** + * Create a fence from an Win32 handle. + * + * This is used for importing a foreign/external fence handle. + * + * \param fence if not NULL, an old fence to unref and transfer a + * new fence reference to + * \param handle opaque handle representing the fence object + * \param type indicates which fence types backs the handle + */ + void (*create_fence_win32)(struct pipe_screen *screen, + struct pipe_fence_handle **fence, + void *handle, + enum pipe_fd_type type); + /** * Returns a driver-specific query. * @@ -526,6 +541,24 @@ struct pipe_screen { */ void (*get_device_uuid)(struct pipe_screen *screen, char *uuid); + /** + * Fill @luid with the locally unique identifier of the context + * The LUID returned, paired together with the contexts node mask, + * allows matching the context to an IDXGIAdapter1 object + * + * \param luid pointer to a memory region of PIPE_LUID_SIZE bytes + */ + void (*get_device_luid)(struct pipe_screen *screen, char *luid); + + /** + * Return the device node mask identifying the context + * Together with the contexts LUID, this allows matching + * the context to an IDXGIAdapter1 object. + * + * within a linked device adapter + */ + uint32_t (*get_device_node_mask)(struct pipe_screen *screen); + /** * Set the maximum number of parallel shader compiler threads. */