Re: [Mesa-dev] [PATCH] anv/pipeline_cache: fix incorrect guards for NIR cache
On 11/01/2019 11:41, Iago Toral wrote: On Fri, 2019-01-11 at 11:13 +, Lionel Landwerlin wrote: On 11/01/2019 10:50, Iago Toral Quiroga wrote: Fixes: f6aa9f718516 'anv/pipeline_cache: Add support for caching NIR' --- src/intel/vulkan/anv_pipeline_cache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Or maybe just check cache->cache instead, which I guess was the original intention, but I kind of prefer having all fields initialized. While looking at this patch, I noticed that we're not freeing nir_cache in anv_pipeline_cache_finish. Right, I'll send a separate patch for that. Iago Thanks a lot :) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] anv/pipeline_cache: fix incorrect guards for NIR cache
On Fri, 2019-01-11 at 11:13 +, Lionel Landwerlin wrote: > On 11/01/2019 10:50, Iago Toral Quiroga wrote: > > Fixes: f6aa9f718516 'anv/pipeline_cache: Add support for caching > > NIR' > > --- > > src/intel/vulkan/anv_pipeline_cache.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > Or maybe just check cache->cache instead, which I guess was the > > original > > intention, but I kind of prefer having all fields initialized. > > > While looking at this patch, I noticed that we're not freeing > nir_cache > in anv_pipeline_cache_finish. Right, I'll send a separate patch for that. Iago > > This looks good : > > > Reviewed-by: Lionel Landwerlin > > > > > > diff --git a/src/intel/vulkan/anv_pipeline_cache.c > > b/src/intel/vulkan/anv_pipeline_cache.c > > index 18f310b06e..f9733c5309 100644 > > --- a/src/intel/vulkan/anv_pipeline_cache.c > > +++ b/src/intel/vulkan/anv_pipeline_cache.c > > @@ -239,6 +239,7 @@ anv_pipeline_cache_init(struct > > anv_pipeline_cache *cache, > >sha1_compare_fun > > c); > > } else { > > cache->cache = NULL; > > + cache->nir_cache = NULL; > > } > > } > > > > @@ -670,7 +671,7 @@ anv_device_search_for_nir(struct anv_device > > *device, > > unsigned char sha1_key[20], > > void *mem_ctx) > > { > > - if (cache) { > > + if (cache && cache->nir_cache) { > > const struct serialized_nir *snir = NULL; > > > > pthread_mutex_lock(>mutex); > > @@ -702,7 +703,7 @@ anv_device_upload_nir(struct anv_device > > *device, > > const struct nir_shader *nir, > > unsigned char sha1_key[20]) > > { > > - if (cache) { > > + if (cache && cache->nir_cache) { > > pthread_mutex_lock(>mutex); > > struct hash_entry *entry = > >_mesa_hash_table_search(cache->nir_cache, sha1_key); > > > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] anv/pipeline_cache: fix incorrect guards for NIR cache
On 11/01/2019 10:50, Iago Toral Quiroga wrote: Fixes: f6aa9f718516 'anv/pipeline_cache: Add support for caching NIR' --- src/intel/vulkan/anv_pipeline_cache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Or maybe just check cache->cache instead, which I guess was the original intention, but I kind of prefer having all fields initialized. While looking at this patch, I noticed that we're not freeing nir_cache in anv_pipeline_cache_finish. This looks good : Reviewed-by: Lionel Landwerlin diff --git a/src/intel/vulkan/anv_pipeline_cache.c b/src/intel/vulkan/anv_pipeline_cache.c index 18f310b06e..f9733c5309 100644 --- a/src/intel/vulkan/anv_pipeline_cache.c +++ b/src/intel/vulkan/anv_pipeline_cache.c @@ -239,6 +239,7 @@ anv_pipeline_cache_init(struct anv_pipeline_cache *cache, sha1_compare_func); } else { cache->cache = NULL; + cache->nir_cache = NULL; } } @@ -670,7 +671,7 @@ anv_device_search_for_nir(struct anv_device *device, unsigned char sha1_key[20], void *mem_ctx) { - if (cache) { + if (cache && cache->nir_cache) { const struct serialized_nir *snir = NULL; pthread_mutex_lock(>mutex); @@ -702,7 +703,7 @@ anv_device_upload_nir(struct anv_device *device, const struct nir_shader *nir, unsigned char sha1_key[20]) { - if (cache) { + if (cache && cache->nir_cache) { pthread_mutex_lock(>mutex); struct hash_entry *entry = _mesa_hash_table_search(cache->nir_cache, sha1_key); ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] anv/pipeline_cache: fix incorrect guards for NIR cache
Fixes: f6aa9f718516 'anv/pipeline_cache: Add support for caching NIR' --- src/intel/vulkan/anv_pipeline_cache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Or maybe just check cache->cache instead, which I guess was the original intention, but I kind of prefer having all fields initialized. diff --git a/src/intel/vulkan/anv_pipeline_cache.c b/src/intel/vulkan/anv_pipeline_cache.c index 18f310b06e..f9733c5309 100644 --- a/src/intel/vulkan/anv_pipeline_cache.c +++ b/src/intel/vulkan/anv_pipeline_cache.c @@ -239,6 +239,7 @@ anv_pipeline_cache_init(struct anv_pipeline_cache *cache, sha1_compare_func); } else { cache->cache = NULL; + cache->nir_cache = NULL; } } @@ -670,7 +671,7 @@ anv_device_search_for_nir(struct anv_device *device, unsigned char sha1_key[20], void *mem_ctx) { - if (cache) { + if (cache && cache->nir_cache) { const struct serialized_nir *snir = NULL; pthread_mutex_lock(>mutex); @@ -702,7 +703,7 @@ anv_device_upload_nir(struct anv_device *device, const struct nir_shader *nir, unsigned char sha1_key[20]) { - if (cache) { + if (cache && cache->nir_cache) { pthread_mutex_lock(>mutex); struct hash_entry *entry = _mesa_hash_table_search(cache->nir_cache, sha1_key); -- 2.17.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev