[Mesa-dev] [PATCH 04/23] glsl: Add image memory and layout qualifiers to ir_variable.

Francisco Jerez currojerez at riseup.net
Tue Nov 26 00:02:20 PST 2013


---
 src/glsl/ir.cpp       |  2 +-
 src/glsl/ir.h         | 14 ++++++++++++++
 src/glsl/ir_clone.cpp |  1 +
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index ffff297..ae690ea 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -1587,7 +1587,7 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
    : max_array_access(0), max_ifc_array_access(NULL),
      read_only(false), centroid(false), invariant(false),
      how_declared(ir_var_declared_normally), mode(mode),
-     interpolation(INTERP_QUALIFIER_NONE), atomic()
+     interpolation(INTERP_QUALIFIER_NONE), atomic(), image()
 {
    this->ir_type = ir_type_variable;
    this->type = type;
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 4f775da..0bf8a12 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -694,6 +694,20 @@ public:
    } atomic;
 
    /**
+    * ARB_shader_image_load_store qualifiers.
+    */
+   struct {
+      bool read_only;
+      bool write_only;
+      bool coherent;
+      bool _volatile;
+      bool _restrict;
+
+      /** Image internal format if specified explicitly, otherwise GL_NONE. */
+      GLenum format;
+   } image;
+
+   /**
     * Built-in state that backs this uniform
     *
     * Once set at variable creation, \c state_slots must remain invariant.
diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp
index ed26aae..afa8075 100644
--- a/src/glsl/ir_clone.cpp
+++ b/src/glsl/ir_clone.cpp
@@ -59,6 +59,7 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
    var->binding = this->binding;
    var->atomic.buffer_index = this->atomic.buffer_index;
    var->atomic.offset = this->atomic.offset;
+   var->image = this->image;
    var->warn_extension = this->warn_extension;
    var->origin_upper_left = this->origin_upper_left;
    var->pixel_center_integer = this->pixel_center_integer;
-- 
1.8.3.4



More information about the mesa-dev mailing list