intel: fix leaking memory on shader creation
ralloc_adopt takes care of all the shader's children, but shader itsel ends up
orphaned and never gets free'd.
Fixes: ef5bce9253
("intel: Drop the last uses of a mem_ctx in nir_builder_init_simple_shader().")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4951
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11651>
This commit is contained in:
@@ -1523,7 +1523,7 @@ brw_nir_create_passthrough_tcs(void *mem_ctx, const struct brw_compiler *compile
|
||||
{
|
||||
nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_TESS_CTRL,
|
||||
options, "passthrough TCS");
|
||||
ralloc_adopt(mem_ctx, b.shader);
|
||||
ralloc_steal(mem_ctx, b.shader);
|
||||
nir_shader *nir = b.shader;
|
||||
nir_variable *var;
|
||||
nir_ssa_def *load;
|
||||
|
Reference in New Issue
Block a user