anv: Fix leak when compiling internal kernels
Cc: mesa-stable Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25928>
This commit is contained in:
@@ -245,6 +245,8 @@ compile_upload_spirv(struct anv_device *device,
|
||||
|
||||
brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data.base.ubo_ranges);
|
||||
|
||||
void *temp_ctx = ralloc_context(NULL);
|
||||
|
||||
const unsigned *program;
|
||||
if (stage == MESA_SHADER_FRAGMENT) {
|
||||
struct brw_compile_stats stats[3];
|
||||
@@ -254,6 +256,7 @@ compile_upload_spirv(struct anv_device *device,
|
||||
.log_data = device,
|
||||
.debug_flag = DEBUG_WM,
|
||||
.stats = stats,
|
||||
.mem_ctx = temp_ctx,
|
||||
},
|
||||
.key = &key.wm,
|
||||
.prog_data = &prog_data.wm,
|
||||
@@ -287,6 +290,7 @@ compile_upload_spirv(struct anv_device *device,
|
||||
.stats = &stats,
|
||||
.log_data = device,
|
||||
.debug_flag = DEBUG_CS,
|
||||
.mem_ctx = temp_ctx,
|
||||
},
|
||||
.key = &key.cs,
|
||||
.prog_data = &prog_data.cs,
|
||||
@@ -314,6 +318,7 @@ compile_upload_spirv(struct anv_device *device,
|
||||
&push_desc_info,
|
||||
0 /* dynamic_push_values */);
|
||||
|
||||
ralloc_free(temp_ctx);
|
||||
ralloc_free(nir);
|
||||
|
||||
return kernel;
|
||||
|
||||
Reference in New Issue
Block a user