st/mesa: call nir_sweep in st_finalize_nir

This is invoked sooner before (pre-)compiling the first variant and is
also applied to fixed-func and ARB programs.
This commit is contained in:
Marek Olšák 2019-11-19 16:35:59 -05:00
parent 4e70cba638
commit 610fb0e19c
2 changed files with 3 additions and 2 deletions

View File

@ -821,8 +821,6 @@ st_link_nir(struct gl_context *ctx,
return false;
}
nir_sweep(prog->nir);
/* The GLSL IR won't be needed anymore. */
ralloc_free(shader->ir);
shader->ir = NULL;

View File

@ -2064,6 +2064,9 @@ st_finalize_program(struct st_context *st, struct gl_program *prog)
st->dirty |= ((struct st_program *)prog)->affected_states;
}
if (prog->nir)
nir_sweep(prog->nir);
/* Create Gallium shaders now instead of on demand. */
if (ST_DEBUG & DEBUG_PRECOMPILE ||
st->shader_has_one_variant[prog->info.stage])