diff --git a/src/intel/blorp/blorp_nir_builder.h b/src/intel/blorp/blorp_nir_builder.h index aa729607cca..2f9464fee6f 100644 --- a/src/intel/blorp/blorp_nir_builder.h +++ b/src/intel/blorp/blorp_nir_builder.h @@ -29,7 +29,8 @@ blorp_nir_init_shader(nir_builder *b, gl_shader_stage stage, const char *name) { - *b = nir_builder_init_simple_shader(mem_ctx, stage, NULL); + *b = nir_builder_init_simple_shader(NULL, stage, NULL); + ralloc_adopt(mem_ctx, b->shader); if (name != NULL) b->shader->info.name = ralloc_strdup(b->shader, name); if (stage == MESA_SHADER_FRAGMENT) diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index b245a36b03c..ff4730a221a 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -1475,8 +1475,9 @@ brw_nir_create_passthrough_tcs(void *mem_ctx, const struct brw_compiler *compile const nir_shader_compiler_options *options, const struct brw_tcs_prog_key *key) { - nir_builder b = nir_builder_init_simple_shader(mem_ctx, MESA_SHADER_TESS_CTRL, + nir_builder b = nir_builder_init_simple_shader(NULL, MESA_SHADER_TESS_CTRL, options); + ralloc_adopt(mem_ctx, b.shader); nir_shader *nir = b.shader; nir_variable *var; nir_intrinsic_instr *load;