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

Author: Timothy Arceri <tarc...@itsqueeze.com>
Date:   Tue Oct 31 11:31:19 2017 +1100

radv: use correct alloc function when loading from disk

Fixes regression in:

dEQP-VK.api.object_management.alloc_callback_fail.graphics_pipeline

Fixes: 1e84e53712ae "radv: add cache items to in memory cache when reading from 
disk"
Reviewed-by: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>

---

 src/amd/vulkan/radv_pipeline_cache.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_pipeline_cache.c 
b/src/amd/vulkan/radv_pipeline_cache.c
index 91470d1419..2904b62e6b 100644
--- a/src/amd/vulkan/radv_pipeline_cache.c
+++ b/src/amd/vulkan/radv_pipeline_cache.c
@@ -276,7 +276,20 @@ radv_create_shader_variants_from_pipeline_cache(struct 
radv_device *device,
                        pthread_mutex_unlock(&cache->mutex);
                        return false;
                } else {
-                       radv_pipeline_cache_add_entry(cache, entry);
+                       size_t size = entry_size(entry);
+                       struct cache_entry *new_entry = vk_alloc(&cache->alloc, 
size, 8,
+                                                                
VK_SYSTEM_ALLOCATION_SCOPE_CACHE);
+                       if (!new_entry) {
+                               free(entry);
+                               pthread_mutex_unlock(&cache->mutex);
+                               return false;
+                       }
+
+                       memcpy(new_entry, entry, entry_size(entry));
+                       free(entry);
+                       entry = new_entry;
+
+                       radv_pipeline_cache_add_entry(cache, new_entry);
                }
        }
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to