st/nir: Rework fixup_varying_slots
[mesa.git] / src / mesa / program / prog_cache.c
index 34609f05696a6a26f6cb642f7f74cc1a5d9b63ab..aee61f90f47136361fe3e5f0b9cff67015835195 100644 (file)
@@ -1,8 +1,8 @@
 /**************************************************************************
- * 
+ *
  * Copyright 2003 VMware, Inc.
  * All Rights Reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the
  * "Software"), to deal in the Software without restriction, including
  * distribute, sub license, and/or sell copies of the Software, and to
  * permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the
  * next paragraph) shall be included in all copies or substantial portions
  * of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
+ *
  **************************************************************************/
 
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
-#include "main/imports.h"
+
 #include "main/shaderobj.h"
 #include "program/prog_cache.h"
 #include "program/program.h"
+#include "util/u_memory.h"
 
 
 struct cache_item
@@ -77,7 +78,7 @@ hash_key(const void *key, GLuint key_size)
 
 
 /**
- * Rebuild/expand the hash table to accomodate more entries
+ * Rebuild/expand the hash table to accommodate more entries
  */
 static void
 rehash(struct gl_program_cache *cache)
@@ -111,7 +112,7 @@ clear_cache(struct gl_context *ctx, struct gl_program_cache *cache,
 {
    struct cache_item *c, *next;
    GLuint i;
-   
+
    cache->last = NULL;
 
    for (i = 0; i < cache->size; i++) {
@@ -219,7 +220,7 @@ _mesa_program_cache_insert(struct gl_context *ctx,
    if (cache->n_items > cache->size * 1.5) {
       if (cache->size < 1000)
         rehash(cache);
-      else 
+      else
         clear_cache(ctx, cache, GL_FALSE);
    }