[Mesa-dev] [PATCH 2/3] mesa: iterate method for string_to_uint_map

Carl Worth cworth at cworth.org
Thu Dec 4 14:00:42 PST 2014


From: Tapani Pälli <tapani.palli at intel.com>

Shader binary cache requires this to be able to cache hash data from
the gl_shader_program structure.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Paul Berry <stereotype441 at gmail.com>
Reviewed-by: Carl Worth <cworth at cworth.org>
---
 src/mesa/program/hash_table.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/program/hash_table.h b/src/mesa/program/hash_table.h
index e95fc49..ece43a1 100644
--- a/src/mesa/program/hash_table.h
+++ b/src/mesa/program/hash_table.h
@@ -229,6 +229,14 @@ public:
    }
 
    /**
+    * Runs a passed callback for the hash
+    */
+   void iterate(void (*func)(const void *, void *, void *), void *closure)
+   {
+      hash_table_call_foreach(this->ht, func, closure);
+   }
+
+   /**
     * Get the value associated with a particular key
     *
     * \return
-- 
2.1.1



More information about the mesa-dev mailing list