anv/pipeline: Don't leak the binding map
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 18 Feb 2016 19:04:53 +0000 (11:04 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 18 Feb 2016 19:09:30 +0000 (11:09 -0800)
src/intel/vulkan/anv_nir_apply_pipeline_layout.c
src/intel/vulkan/anv_pipeline.c
src/intel/vulkan/genX_pipeline.c

index c58a93878ee3036cf0446fe1615a52f238250503..4600872d1f6c07532764e73ae4ea46d199b4977e 100644 (file)
@@ -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);
 }
index a7feefb540e8c0fb879a829d6975182463f62b6c..2f1ce3956a95dd5fa6aa530fcdacc685df5520b1 100644 (file)
@@ -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)
index 4c2e0bc6e0d6f18ecf4c0ecb79c70e4b17496bd1..54ec8307d024ffcb96ece3edf0fecfc2f8589288 100644 (file)
@@ -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;