Mesa (master): radv: Update code pointer correctly if a variant is already created

Bas Nieuwenhuizen bnieuwenhuizen at kemper.freedesktop.org
Mon Oct 23 20:39:29 UTC 2017


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

Author: Alex Smith <asmith at feralinteractive.com>
Date:   Mon Oct 23 10:37:42 2017 +0100

radv: Update code pointer correctly if a variant is already created

This was the actual cause of GPU hangs fixed by 0fdd531457ec ("radv:
Fix pipeline cache locking issues"), since multiple threads would end
up trying to create the variants for a single entry.

Now that we're locking around the whole of this function, this isn't
really necessary (we either create all or none of the variants), but
fix this anyway in case things change later.

Signed-off-by: Alex Smith <asmith at feralinteractive.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
CC: 17.3 <mesa-stable at lists.freedesktop.org>

---

 src/amd/vulkan/radv_pipeline_cache.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/amd/vulkan/radv_pipeline_cache.c b/src/amd/vulkan/radv_pipeline_cache.c
index a75356b822..9ba9a3b61b 100644
--- a/src/amd/vulkan/radv_pipeline_cache.c
+++ b/src/amd/vulkan/radv_pipeline_cache.c
@@ -231,6 +231,8 @@ radv_create_shader_variants_from_pipeline_cache(struct radv_device *device,
 			p += entry->code_sizes[i];
 
 			entry->variants[i] = variant;
+		} else if (entry->code_sizes[i]) {
+			p += sizeof(struct cache_entry_variant_info) + entry->code_sizes[i];
 		}
 
 	}




More information about the mesa-commit mailing list