gallium/ureg: Set the next shader stage from the shader info.
[mesa.git] / src / gallium / auxiliary / cso_cache / cso_cache.c
index b240c938dcc7154abaf4365796e18d09eb8e7a73..6cae21ca871957d2ca185705e73efd484252fc84 100644 (file)
@@ -37,7 +37,7 @@
 
 
 struct cso_cache {
-   struct cso_hash *hashes[CSO_CACHE_MAX];
+   struct cso_hash hashes[CSO_CACHE_MAX];
    int    max_size;
 
    cso_sanitize_callback sanitize_cb;
@@ -82,12 +82,10 @@ unsigned cso_construct_key(void *item, int item_size)
 
 static inline struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_type type)
 {
-   struct cso_hash *hash;
-   hash = sc->hashes[type];
-   return hash;
+   return &sc->hashes[type];
 }
 
-static void delete_blend_state(void *state, void *data)
+static void delete_blend_state(void *state, UNUSED void *data)
 {
    struct cso_blend *cso = (struct cso_blend *)state;
    if (cso->delete_state)
@@ -95,7 +93,7 @@ static void delete_blend_state(void *state, void *data)
    FREE(state);
 }
 
-static void delete_depth_stencil_state(void *state, void *data)
+static void delete_depth_stencil_state(void *state, UNUSED void *data)
 {
    struct cso_depth_stencil_alpha *cso = (struct cso_depth_stencil_alpha *)state;
    if (cso->delete_state)
@@ -103,7 +101,7 @@ static void delete_depth_stencil_state(void *state, void *data)
    FREE(state);
 }
 
-static void delete_sampler_state(void *state, void *data)
+static void delete_sampler_state(void *state, UNUSED void *data)
 {
    struct cso_sampler *cso = (struct cso_sampler *)state;
    if (cso->delete_state)
@@ -111,7 +109,7 @@ static void delete_sampler_state(void *state, void *data)
    FREE(state);
 }
 
-static void delete_rasterizer_state(void *state, void *data)
+static void delete_rasterizer_state(void *state, UNUSED void *data)
 {
    struct cso_rasterizer *cso = (struct cso_rasterizer *)state;
    if (cso->delete_state)
@@ -119,7 +117,7 @@ static void delete_rasterizer_state(void *state, void *data)
    FREE(state);
 }
 
-static void delete_velements(void *state, void *data)
+static void delete_velements(void *state, UNUSED void *data)
 {
    struct cso_velements *cso = (struct cso_velements *)state;
    if (cso->delete_state)
@@ -163,7 +161,7 @@ static inline void sanitize_hash(struct cso_cache *sc,
 
 
 static inline void sanitize_cb(struct cso_hash *hash, enum cso_cache_type type,
-                               int max_size, void *user_data)
+                              int max_size, UNUSED void *user_data)
 {
    /* if we're approach the maximum size, remove fourth of the entries
     * otherwise every subsequent call will go through the same */
@@ -252,7 +250,7 @@ struct cso_cache *cso_cache_create(void)
 
    sc->max_size           = 4096;
    for (i = 0; i < CSO_CACHE_MAX; i++)
-      sc->hashes[i] = cso_hash_create();
+      cso_hash_init(&sc->hashes[i]);
 
    sc->sanitize_cb        = sanitize_cb;
    sc->sanitize_data      = 0;
@@ -292,7 +290,7 @@ void cso_cache_delete(struct cso_cache *sc)
    cso_for_each_state(sc, CSO_VELEMENTS, delete_velements, 0);
 
    for (i = 0; i < CSO_CACHE_MAX; i++)
-      cso_hash_delete(sc->hashes[i]);
+      cso_hash_deinit(&sc->hashes[i]);
 
    FREE(sc);
 }
@@ -304,7 +302,7 @@ void cso_set_maximum_cache_size(struct cso_cache *sc, int number)
    sc->max_size = number;
 
    for (i = 0; i < CSO_CACHE_MAX; i++)
-      sanitize_hash(sc, sc->hashes[i], i, sc->max_size);
+      sanitize_hash(sc, &sc->hashes[i], i, sc->max_size);
 }
 
 int cso_maximum_cache_size(const struct cso_cache *sc)