summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-09-29 10:06:17 -0700
committerJason Ekstrand <[email protected]>2017-10-12 22:39:30 -0700
commit9df64b56663c3ffaee081aa608db9e5163a4eeae (patch)
tree4e8522c87cea003483ed867c6c5f0adfef74fa60 /src
parent490d80fd1a55287b31ce62d0bf07801316632e78 (diff)
anv/pipeline: Ralloc prog_data::param of the compile mem_ctx
This way we stop leaking it. This is completely safe because, when we hand it off to anv_shader_bin_create or anv_pipeline_cache_upload_kernel, they make a copy of the entire param array. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/vulkan/anv_pipeline.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index be67392625b..1e81edd390c 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -417,8 +417,7 @@ anv_pipeline_compile(struct anv_pipeline *pipeline,
pipeline->needs_data_cache = true;
if (prog_data->nr_params > 0) {
- /* XXX: I think we're leaking this */
- prog_data->param = malloc(prog_data->nr_params * sizeof(uint32_t));
+ prog_data->param = ralloc_array(mem_ctx, uint32_t, prog_data->nr_params);
/* We now set the param values to be offsets into a
* anv_push_constant_data structure. Since the compiler doesn't