nvk: Don't free the NIR in nvk_compile_nir

It's a layering violation and the NIR is currently leaked if we the
compile fails.  It's better to make the caller clean up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand
2023-01-30 20:11:52 -06:00
committed by Marge Bot
parent ffc6c3afaf
commit 782d376363
2 changed files with 1 additions and 1 deletions
@@ -101,6 +101,7 @@ nvk_compute_pipeline_create(struct nvk_device *device,
nvk_lower_nir(device, nir, pipeline_layout);
result = nvk_compile_nir(pdevice, nir, &pipeline->base.shaders[MESA_SHADER_COMPUTE]);
ralloc_free(nir);
if (result != VK_SUCCESS)
goto fail;
-1
View File
@@ -193,7 +193,6 @@ nvk_compile_nir(struct nvk_physical_device *device, nir_shader *nir,
if (info_out.io.fp64)
shader->hdr[0] |= 1 << 27;
ralloc_free(nir);
return VK_SUCCESS;
}