mesa: Allow glGetTexParameter of GL_TEXTURE_SRGB_DECODE_EXT
[mesa.git] / src / mesa / main / hash.c
index 4b250ad546874c6cfb0d5600789b93026f7d25db..61c369a80cdada0d2fc67562875942a5fd92e877 100644 (file)
@@ -480,6 +480,26 @@ _mesa_HashFindFreeKeyBlock(struct _mesa_HashTable *table, GLuint numKeys)
 }
 
 
+/**
+ * Return the number of entries in the hash table.
+ */
+GLuint
+_mesa_HashNumEntries(const struct _mesa_HashTable *table)
+{
+   GLuint pos, count = 0;
+
+   for (pos = 0; pos < TABLE_SIZE; pos++) {
+      const struct HashEntry *entry;
+      for (entry = table->Table[pos]; entry; entry = entry->Next) {
+         count++;
+      }
+   }
+
+   return count;
+}
+
+
+
 #if 0 /* debug only */
 
 /**