radeonsi: print shader cache stats with AMD_DEBUG=cache_stats
[mesa.git] / src / gallium / auxiliary / util / u_live_shader_cache.c
index 9299348e0af54d5d1f28cdce5d1440fea43228b0..9c59b5fd3cfb5e529d1c7083ce5aa347c4f57b22 100644 (file)
@@ -118,8 +118,10 @@ util_live_shader_cache_get(struct pipe_context *ctx,
    struct util_live_shader *shader = entry ? entry->data : NULL;
 
    /* Increase the refcount. */
-   if (shader)
+   if (shader) {
       pipe_reference(NULL, &shader->reference);
+      cache->hits++;
+   }
    simple_mtx_unlock(&cache->lock);
 
    /* Return if the shader already exists. */
@@ -148,6 +150,7 @@ util_live_shader_cache_get(struct pipe_context *ctx,
    } else {
       _mesa_hash_table_insert(cache->hashtable, shader->sha1, shader);
    }
+   cache->misses++;
    simple_mtx_unlock(&cache->lock);
 
    return shader;