gallium: add access field to pipe_image_view
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sat, 12 Mar 2016 01:04:19 +0000 (20:04 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 14 Mar 2016 22:24:40 +0000 (17:24 -0500)
This allows drivers to make smarter decisions e.g. about whether the image
has to be decompressed.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/include/pipe/p_defines.h
src/gallium/include/pipe/p_state.h

index a490b3b98ea8b2311d9beda62d56c0892a39f2f6..bdd76ab1f81da1238d13f9c1e75958beb2737d6f 100644 (file)
@@ -540,6 +540,14 @@ enum pipe_reset_status
 #define PIPE_HANDLE_USAGE_READ_WRITE      (PIPE_HANDLE_USAGE_READ | \
                                            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()
index c568c483940d0371608e8195a55d05b2f8fe5560..2e720ce25f3505c9ad6418d077e91cf5a4feec60 100644 (file)
@@ -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 {