glsl: Put `sample`-qualified varyings in their own packing classes
[mesa.git] / src / glsl / loop_analysis.h
index 8bed1db02106368e78d6c333bd8ae3fde6948a68..98414b3c6149dc4e78c5b907138ef2f59b6f1ed4 100644 (file)
@@ -70,11 +70,6 @@ public:
    class loop_terminator *insert(ir_if *);
 
 
-   /**
-    * Loop whose variable state is being tracked by this structure
-    */
-   ir_loop *loop;
-
    /**
     * Variables that have not yet been classified
     */
@@ -140,6 +135,23 @@ public:
    {
       hash_table_dtor(this->var_hash);
    }
+
+   static void* operator new(size_t size, void *ctx)
+   {
+      void *lvs = ralloc_size(ctx, size);
+      assert(lvs != NULL);
+
+      ralloc_set_destructor(lvs, (void (*)(void*)) destructor);
+
+      return lvs;
+   }
+
+private:
+   static void
+   destructor(loop_variable_state *lvs)
+   {
+      lvs->~loop_variable_state();
+   }
 };
 
 
@@ -232,7 +244,7 @@ private:
 
    void *mem_ctx;
 
-   friend class loop_analysis;
+   friend loop_state *analyze_loop_variables(exec_list *instructions);
 };
 
 #endif /* LOOP_ANALYSIS_H */