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

Author: Jason Ekstrand <[email protected]>
Date:   Thu Feb 18 11:04:53 2016 -0800

anv/pipeline: Don't leak the binding map

---

 src/intel/vulkan/anv_nir_apply_pipeline_layout.c | 2 ++
 src/intel/vulkan/anv_pipeline.c                  | 5 +++++
 src/intel/vulkan/genX_pipeline.c                 | 1 +
 3 files changed, 8 insertions(+)

diff --git a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c 
b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c
index c58a938..4600872 100644
--- a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c
+++ b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c
@@ -391,4 +391,6 @@ anv_nir_apply_pipeline_layout(struct anv_pipeline *pipeline,
 
       shader->num_uniforms += map.image_count * BRW_IMAGE_PARAM_SIZE * 4;
    }
+
+   ralloc_free(mem_ctx);
 }
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index a7feefb..2f1ce39 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -193,6 +193,11 @@ void anv_DestroyPipeline(
    ANV_FROM_HANDLE(anv_device, device, _device);
    ANV_FROM_HANDLE(anv_pipeline, pipeline, _pipeline);
 
+   for (unsigned s = 0; s < MESA_SHADER_STAGES; s++) {
+      free(pipeline->bindings[s].surface_to_descriptor);
+      free(pipeline->bindings[s].sampler_to_descriptor);
+   }
+
    anv_reloc_list_finish(&pipeline->batch_relocs,
                          pAllocator ? pAllocator : &device->alloc);
    if (pipeline->blend_state.map)
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c
index 4c2e0bc..54ec8307 100644
--- a/src/intel/vulkan/genX_pipeline.c
+++ b/src/intel/vulkan/genX_pipeline.c
@@ -72,6 +72,7 @@ genX(compute_pipeline_create)(
     */
    memset(pipeline->prog_data, 0, sizeof(pipeline->prog_data));
    memset(pipeline->scratch_start, 0, sizeof(pipeline->scratch_start));
+   memset(pipeline->bindings, 0, sizeof(pipeline->bindings));
 
    pipeline->vs_simd8 = NO_KERNEL;
    pipeline->vs_vec4 = NO_KERNEL;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to