Mesa (master): iris: Change keybox parenting

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 22 17:52:02 UTC 2019


Module: Mesa
Branch: master
Commit: acd36e488d359f26ebdc678bd16a98682dfd590f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=acd36e488d359f26ebdc678bd16a98682dfd590f

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Jun  5 13:15:35 2019 -0700

iris: Change keybox parenting

For temporary lookups, just allocate out of the NULL ralloc context,
so we don't have to edit the linked list of ralloc children to add it
and then immediately remove it again.

When uploading a new shader, allocate the keybox off the shader, so
if we delete the shader the keybox also goes away.  Less manual cleanup.

---

 src/gallium/drivers/iris/iris_program_cache.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_program_cache.c b/src/gallium/drivers/iris/iris_program_cache.c
index 4ec2a52c2de..2c1224482c2 100644
--- a/src/gallium/drivers/iris/iris_program_cache.c
+++ b/src/gallium/drivers/iris/iris_program_cache.c
@@ -89,8 +89,7 @@ iris_find_cached_shader(struct iris_context *ice,
                         uint32_t key_size,
                         const void *key)
 {
-   struct keybox *keybox =
-      make_keybox(ice->shaders.cache, cache_id, key, key_size);
+   struct keybox *keybox = make_keybox(NULL, cache_id, key, key_size);
    struct hash_entry *entry =
       _mesa_hash_table_search(ice->shaders.cache, keybox);
 
@@ -191,7 +190,7 @@ iris_upload_shader(struct iris_context *ice,
    /* Store the 3DSTATE shader packets and other derived state. */
    ice->vtbl.store_derived_program_state(ice, cache_id, shader);
 
-   struct keybox *keybox = make_keybox(cache, cache_id, key, key_size);
+   struct keybox *keybox = make_keybox(shader, cache_id, key, key_size);
    _mesa_hash_table_insert(ice->shaders.cache, keybox, shader);
 
    return shader;




More information about the mesa-commit mailing list