summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-11-19 16:35:59 -0500
committerMarek Olšák <[email protected]>2019-11-19 18:02:06 -0500
commit610fb0e19cb5eb83677b485bb931e3f71e976f4d (patch)
tree753418557e8ee4b2438cd792b9eeeb373c451613 /src/mesa
parent4e70cba638b98ee2e3952d30ac767ce9f325656c (diff)
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.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp2
-rw-r--r--src/mesa/state_tracker/st_program.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index a236908c1b1..27ad14518a1 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -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;
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 62d4de3d5b5..12061ed91f1 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -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])