aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_screen.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-10-09 18:44:50 +0200
committerMarek Olšák <[email protected]>2017-10-12 19:03:33 +0200
commit07fdc0a09cd8f7af8231c4bede158588c6649ce4 (patch)
tree585e11ca368297335aae9bdc57ba2f4c1b603b0c /src/gallium/include/pipe/p_screen.h
parent5f2073be3282a233a8b5bcb5342ea5e599b9b316 (diff)
gallium: add pipe_screen::check_resource_capability
This is optional (and no CAP). Implemented by radeonsi, ddebug, rbug, trace. Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/include/pipe/p_screen.h')
-rw-r--r--src/gallium/include/pipe/p_screen.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index 8c6028a0fca..c249c7d63b4 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -205,6 +205,23 @@ struct pipe_screen {
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
* DISPLAYTARGET or PRIMARY.