From d4c2a7f22baa450f7b359112d353f557858c9896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 2 Aug 2024 19:21:04 +0300 Subject: [PATCH] vkd3d: Pass a proper struct shader_cache_key * to rb_put() in vkd3d_shader_cache_add_entry(). --- libs/vkd3d/cache.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d/cache.c b/libs/vkd3d/cache.c index a0a29ed3..11d87ac1 100644 --- a/libs/vkd3d/cache.c +++ b/libs/vkd3d/cache.c @@ -69,7 +69,14 @@ static int vkd3d_shader_cache_compare_key(const void *key, const struct rb_entry static void vkd3d_shader_cache_add_entry(struct vkd3d_shader_cache *cache, struct shader_cache_entry *e) { - rb_put(&cache->tree, &e->h.hash, &e->entry); + const struct shader_cache_key k = + { + .hash = e->h.hash, + .key_size = e->h.key_size, + .key = e->payload + }; + + rb_put(&cache->tree, &k, &e->entry); } int vkd3d_shader_open_cache(struct vkd3d_shader_cache **cache)