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:
@@ -29,7 +29,8 @@ blorp_nir_init_shader(nir_builder *b,
|
|||||||
gl_shader_stage stage,
|
gl_shader_stage stage,
|
||||||
const char *name)
|
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)
|
if (name != NULL)
|
||||||
b->shader->info.name = ralloc_strdup(b->shader, name);
|
b->shader->info.name = ralloc_strdup(b->shader, name);
|
||||||
if (stage == MESA_SHADER_FRAGMENT)
|
if (stage == MESA_SHADER_FRAGMENT)
|
||||||
|
@@ -1475,8 +1475,9 @@ brw_nir_create_passthrough_tcs(void *mem_ctx, const struct brw_compiler *compile
|
|||||||
const nir_shader_compiler_options *options,
|
const nir_shader_compiler_options *options,
|
||||||
const struct brw_tcs_prog_key *key)
|
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);
|
options);
|
||||||
|
ralloc_adopt(mem_ctx, b.shader);
|
||||||
nir_shader *nir = b.shader;
|
nir_shader *nir = b.shader;
|
||||||
nir_variable *var;
|
nir_variable *var;
|
||||||
nir_intrinsic_instr *load;
|
nir_intrinsic_instr *load;
|
||||||
|
Reference in New Issue
Block a user