From 12f1a4c311ce45835409c20ce76f39d3dcf950ea Mon Sep 17 00:00:00 2001 From: Antonio Gomes Date: Mon, 6 Nov 2023 12:22:53 -0300 Subject: [PATCH] gallium: Add new PIPE_CAP_CL_GL_SHARING MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have a situation where some drivers have all the required features, but they are not working with gl_sharing, so we end up advertising it wrongly. Add this cap to ensure this driver was tested to work with cl_khr_gl_sharing. Reviewed-by: Karol Herbst Reviewed-by: Marek Olšák Part-of: --- docs/gallium/screen.rst | 2 ++ src/gallium/auxiliary/util/u_screen.c | 3 +++ src/gallium/include/pipe/p_defines.h | 1 + 3 files changed, 6 insertions(+) diff --git a/docs/gallium/screen.rst b/docs/gallium/screen.rst index c4f0881f341..8d418316d76 100644 --- a/docs/gallium/screen.rst +++ b/docs/gallium/screen.rst @@ -564,6 +564,8 @@ The integer capabilities: 1. ``DRM_PRIME_CAP_IMPORT``: resource_from_handle is supported 2. ``DRM_PRIME_CAP_EXPORT``: resource_get_handle is supported +* ``PIPE_CAP_CL_GL_SHARING``: True if driver supports everything required by a frontend implementing the CL extension, and + also supports importing/exporting all of pipe_texture_target via dma buffers. * ``PIPE_CAP_PREFER_COMPUTE_FOR_MULTIMEDIA``: Whether VDPAU, VAAPI, and OpenMAX should use a compute-based blit instead of pipe_context::blit and compute pipeline for compositing images. * ``PIPE_CAP_FRAGMENT_SHADER_INTERLOCK``: True if fragment shader interlock diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c index 78cc8d9bb3f..a9c3f6c37dd 100644 --- a/src/gallium/auxiliary/util/u_screen.c +++ b/src/gallium/auxiliary/util/u_screen.c @@ -451,6 +451,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen, return 0; #endif + case PIPE_CAP_CL_GL_SHARING: + return 0; + case PIPE_CAP_TEXTURE_SHADOW_MAP: /* Enables ARB_shadow */ return 1; diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index f96b1073189..ee6d894a65a 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -861,6 +861,7 @@ enum pipe_cap PIPE_CAP_IMAGE_STORE_FORMATTED, PIPE_CAP_THROTTLE, PIPE_CAP_DMABUF, + PIPE_CAP_CL_GL_SHARING, PIPE_CAP_PREFER_COMPUTE_FOR_MULTIMEDIA, PIPE_CAP_FRAGMENT_SHADER_INTERLOCK, PIPE_CAP_FBFETCH_COHERENT,