From 07fdc0a09cd8f7af8231c4bede158588c6649ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 9 Oct 2017 18:44:50 +0200 Subject: gallium: add pipe_screen::check_resource_capability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is optional (and no CAP). Implemented by radeonsi, ddebug, rbug, trace. Reviewed-by: Daniel Stone Reviewed-by: Nicolai Hähnle --- src/gallium/include/pipe/p_screen.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/gallium/include') diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 8c6028a0fc..c249c7d63b 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -204,6 +204,23 @@ struct pipe_screen { const struct pipe_resource *t, void *user_memory); + /** + * Unlike pipe_resource::bind, which describes what state trackers want, + * resources can have much greater capabilities in practice, often implied + * by the tiling layout or memory placement. This function allows querying + * whether a capability is supported beyond what was requested by state + * trackers. It's also useful for querying capabilities of imported + * resources where the capabilities are unknown at first. + * + * Only these flags are allowed: + * - PIPE_BIND_SCANOUT + * - PIPE_BIND_CURSOR + * - PIPE_BIND_LINEAR + */ + bool (*check_resource_capability)(struct pipe_screen *screen, + struct pipe_resource *resource, + unsigned bind); + /** * Get a winsys_handle from a texture. Some platforms/winsys requires * that the texture is created with a special usage flag like -- cgit v1.2.3