mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
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:
parent
f5876dfdb9
commit
974c58b317
2 changed files with 2 additions and 2 deletions
|
|
@ -30,7 +30,7 @@ blorp_nir_init_shader(nir_builder *b,
|
|||
const char *name)
|
||||
{
|
||||
*b = nir_builder_init_simple_shader(stage, NULL, "%s", name ? name : "");
|
||||
ralloc_adopt(mem_ctx, b->shader);
|
||||
ralloc_steal(mem_ctx, b->shader);
|
||||
if (stage == MESA_SHADER_FRAGMENT)
|
||||
b->shader->info.fs.origin_upper_left = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue