[Mesa-dev] [PATCH 06/10] gallium: add access field to pipe_image_view
Nicolai Hähnle
nhaehnle at gmail.com
Sun Mar 13 14:29:48 UTC 2016
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
This allows drivers to make smarter decisions e.g. about whether the image
has to be decompressed.
---
src/gallium/include/pipe/p_defines.h | 8 ++++++++
src/gallium/include/pipe/p_state.h | 3 ++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index a490b3b..bdd76ab 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -541,6 +541,14 @@ enum pipe_reset_status
PIPE_HANDLE_USAGE_WRITE)
/**
+ * pipe_image_view access flags.
+ */
+#define PIPE_IMAGE_ACCESS_READ (1 << 0)
+#define PIPE_IMAGE_ACCESS_WRITE (1 << 1)
+#define PIPE_IMAGE_ACCESS_READ_WRITE (PIPE_IMAGE_ACCESS_READ | \
+ PIPE_IMAGE_ACCESS_WRITE)
+
+/**
* Implementation capabilities/limits which are queried through
* pipe_screen::get_param()
*/
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index c568c48..2e720ce 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -393,13 +393,14 @@ struct pipe_sampler_view
/**
- * A description of a writable buffer or texture that can be bound to a shader
+ * A description of a buffer or texture image that can be bound to a shader
* stage.
*/
struct pipe_image_view
{
struct pipe_resource *resource; /**< resource into which this is a view */
enum pipe_format format; /**< typed PIPE_FORMAT_x */
+ unsigned access; /**< PIPE_IMAGE_ACCESS_x */
union {
struct {
--
2.5.0
More information about the mesa-dev
mailing list