radv: Update code pointer correctly if a variant is already created
authorAlex Smith <asmith@feralinteractive.com>
Mon, 23 Oct 2017 09:37:42 +0000 (10:37 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 23 Oct 2017 20:36:54 +0000 (22:36 +0200)
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@feralinteractive.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
CC: 17.3 <mesa-stable@lists.freedesktop.org>
src/amd/vulkan/radv_pipeline_cache.c

index a75356b82297d6fd1020def92a2afdcb9fdc3c4b..9ba9a3b61ba52b1ea5e4ed784465f3a4b3f5980b 100644 (file)
@@ -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];
                }
 
        }