<div dir="auto">R-b</div><div class="gmail_extra"><br><div class="gmail_quote">On 31 Oct 2017 01:35, "Timothy Arceri" <<a href="mailto:tarceri@itsqueeze.com">tarceri@itsqueeze.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fixes regression in:<br>
<br>
dEQP-VK.api.object_management.<wbr>alloc_callback_fail.graphics_<wbr>pipeline<br>
<br>
Fixes: 1e84e53712ae "radv: add cache items to in memory cache when reading from disk"<br>
---<br>
 src/amd/vulkan/radv_pipeline_<wbr>cache.c | 15 ++++++++++++++-<br>
 1 file changed, 14 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/amd/vulkan/radv_<wbr>pipeline_cache.c b/src/amd/vulkan/radv_<wbr>pipeline_cache.c<br>
index 91470d1419..2904b62e6b 100644<br>
--- a/src/amd/vulkan/radv_<wbr>pipeline_cache.c<br>
+++ b/src/amd/vulkan/radv_<wbr>pipeline_cache.c<br>
@@ -269,21 +269,34 @@ radv_create_shader_variants_<wbr>from_pipeline_cache(struct radv_device *device,<br>
                uint8_t disk_sha1[20];<br>
                disk_cache_compute_key(device-<wbr>>physical_device->disk_cache,<br>
                                       sha1, 20, disk_sha1);<br>
                entry = (struct cache_entry *)<br>
                        disk_cache_get(device-><wbr>physical_device->disk_cache,<br>
                                       disk_sha1, NULL);<br>
                if (!entry) {<br>
                        pthread_mutex_unlock(&cache-><wbr>mutex);<br>
                        return false;<br>
                } else {<br>
-                       radv_pipeline_cache_add_entry(<wbr>cache, entry);<br>
+                       size_t size = entry_size(entry);<br>
+                       struct cache_entry *new_entry = vk_alloc(&cache->alloc, size, 8,<br>
+                                                                VK_SYSTEM_ALLOCATION_SCOPE_<wbr>CACHE);<br>
+                       if (!new_entry) {<br>
+                               free(entry);<br>
+                               pthread_mutex_unlock(&cache-><wbr>mutex);<br>
+                               return false;<br>
+                       }<br>
+<br>
+                       memcpy(new_entry, entry, entry_size(entry));<br>
+                       free(entry);<br>
+                       entry = new_entry;<br>
+<br>
+                       radv_pipeline_cache_add_entry(<wbr>cache, new_entry);<br>
                }<br>
        }<br>
<br>
        char *p = entry->code;<br>
        for(int i = 0; i < MESA_SHADER_STAGES; ++i) {<br>
                if (!entry->variants[i] && entry->code_sizes[i]) {<br>
                        struct radv_shader_variant *variant;<br>
                        struct cache_entry_variant_info info;<br>
<br>
                        variant = calloc(1, sizeof(struct radv_shader_variant));<br>
--<br>
2.14.3<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div>