From 5a59a331e21dcf2f6fb805cccf2aa84cb40d98cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pi=C3=B1eiro?= Date: Fri, 7 Aug 2020 02:21:45 +0200 Subject: [PATCH] v3dv/pipeline: fix combined_index_map insertions We were inserting as key directly the local key variable used to search for entries, but hash_table expect a real pointer. Fixed by using the array of keys that we already had at v3dv_pipeline. Fixed failures on the rpi4 like: dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.a1r5g5b5_unorm_pack16.a1r5g5b5_unorm_pack16.general_general_linear but fwiw, this tests on the simulator, and several other tests on both the simulator and rpi4, were working just by luck. Part-of: --- src/broadcom/vulkan/v3dv_pipeline.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c index def0406069e..46a4eee9972 100644 --- a/src/broadcom/vulkan/v3dv_pipeline.c +++ b/src/broadcom/vulkan/v3dv_pipeline.c @@ -643,11 +643,12 @@ get_combined_index(struct v3dv_pipeline *pipeline, return (uint32_t)(uintptr_t) (entry->data); uint32_t new_index = pipeline->next_combined_index; - - _mesa_hash_table_insert(ht, &key, (void *)(uintptr_t) (new_index)); - pipeline->combined_index_to_key_map[new_index] = key; pipeline->next_combined_index++; + pipeline->combined_index_to_key_map[new_index] = key; + _mesa_hash_table_insert(ht, &pipeline->combined_index_to_key_map[new_index], + (void *)(uintptr_t) (new_index)); + return new_index; }