intel: Drop the last uses of a mem_ctx in nir_builder_init_simple_shader().

These two consumers were the only ones out of the ~65 calls to
init_simple_shader, so there's a pretty clear consensus on how to allocate
simple shaders.  I suspect that actually these would be just fine with
b.shader being the mem_ctx, but that would take a bit more rework.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7323>
This commit is contained in:
Eric Anholt
2020-10-26 11:25:08 -07:00
parent 2f372572a1
commit ef5bce9253
2 changed files with 4 additions and 2 deletions

View File

@@ -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)

View File

@@ -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;