glsl: rename record_location_offset() -> struct_location_offset()
[mesa.git] / src / compiler / glsl / ir_array_refcount.h
index 2988046aaedbdc9451edf45531d9be5156736e78..ef3fbaa368d3f3bdc6a49bde7bb178e84471fb58 100644 (file)
@@ -27,6 +27,9 @@
  * Provides a visitor which produces a list of variables referenced.
  */
 
+#ifndef GLSL_IR_ARRAY_REFCOUNT_H
+#define GLSL_IR_ARRAY_REFCOUNT_H
+
 #include "ir.h"
 #include "ir_visitor.h"
 #include "compiler/glsl_types.h"
@@ -140,6 +143,7 @@ public:
    virtual ir_visitor_status visit(ir_dereference_variable *);
 
    virtual ir_visitor_status visit_enter(ir_function_signature *);
+   virtual ir_visitor_status visit_enter(ir_dereference_array *);
 
    /**
     * Find variable in the hash table, and insert it if not present
@@ -157,6 +161,15 @@ private:
    /** Get an array_deref_range element from private tracking. */
    array_deref_range *get_array_deref();
 
+   /**
+    * Last ir_dereference_array that was visited
+    *
+    * Used to prevent some redundant calculations.
+    *
+    * \sa ::visit_enter(ir_dereference_array *)
+    */
+   ir_dereference_array *last_array_deref;
+
    /**
     * \name array_deref_range tracking
     */
@@ -171,3 +184,5 @@ private:
    unsigned derefs_size;
    /*@}*/
 };
+
+#endif /* GLSL_IR_ARRAY_REFCOUNT_H */