cso: Store hash key in struct cso_sampler
authorMichel Dänzer <michel.daenzer@amd.com>
Fri, 16 Dec 2016 02:41:54 +0000 (11:41 +0900)
committerMichel Dänzer <michel@daenzer.net>
Mon, 19 Dec 2016 08:51:31 +0000 (17:51 +0900)
Preparation for following changes, no functional change intended.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/auxiliary/cso_cache/cso_cache.h
src/gallium/auxiliary/cso_cache/cso_context.c

index 052245f96f19ce2dea1f7baccbd020401e3ed2df..ab1e4af0adfa06513a80b8e6afc23e4a627ec415 100644 (file)
@@ -129,6 +129,7 @@ struct cso_sampler {
    void *data;
    cso_state_callback delete_state;
    struct pipe_context *context;
+   unsigned hash_key;
 };
 
 struct cso_velems_state {
index 0f4a333ab0accc83656b59abf0789073f1b5db1f..6031cfc0d234d8bd4fbdf20c1cbf3b308182c405 100644 (file)
@@ -1182,6 +1182,7 @@ cso_single_sampler(struct cso_context *ctx, unsigned shader_stage,
          cso->delete_state =
             (cso_state_callback) ctx->pipe->delete_sampler_state;
          cso->context = ctx->pipe;
+         cso->hash_key = hash_key;
 
          iter = cso_insert_state(ctx->cache, hash_key, CSO_SAMPLER, cso);
          if (cso_hash_iter_is_null(iter)) {