Merge commit 'origin/master' into gallium-sampler-view
[mesa.git] / src / gallium / auxiliary / cso_cache / cso_hash.c
index 8d867f86d2d9c21dfc0e73bdacaa2d3cf0b4d300..288cef7b6faea8472a5687dfe36d564cb8c28556 100644 (file)
@@ -30,8 +30,8 @@
   *   Zack Rusin <zack@tungstengraphics.com>
   */
 
-#include "pipe/p_debug.h"
-#include "pipe/p_util.h"
+#include "util/u_debug.h"
+#include "util/u_memory.h"
 
 #include "cso_hash.h"
 
@@ -228,8 +228,10 @@ struct cso_hash_iter cso_hash_insert(struct cso_hash *hash,
          return null_iter;
       }
 
-      struct cso_hash_iter iter = {hash, node};
-      return iter;
+      {
+         struct cso_hash_iter iter = {hash, node};
+         return iter;
+      }
    }
 }
 
@@ -429,3 +431,9 @@ struct cso_hash_iter cso_hash_erase(struct cso_hash *hash, struct cso_hash_iter
    --hash->data.d->size;
    return ret;
 }
+
+boolean cso_hash_contains(struct cso_hash *hash, unsigned key)
+{
+   struct cso_node **node = cso_hash_find_node(hash, key);
+   return (*node != hash->data.e);
+}