}
c->s = nir_shader_clone(c, key->shader_state->base.ir.nir);
- NIR_PASS_V(c->s, nir_opt_global_to_local);
- NIR_PASS_V(c->s, nir_convert_to_ssa);
if (stage == QSTAGE_FRAG)
NIR_PASS_V(c->s, vc4_nir_lower_blend, c);
tex_options.lower_srgb |= (1 << i);
}
- NIR_PASS_V(c->s, nir_normalize_cubemap_coords);
NIR_PASS_V(c->s, nir_lower_tex, &tex_options);
if (c->fs_key && c->fs_key->light_twoside)
NIR_PASS_V(c->s, vc4_nir_lower_io, c);
NIR_PASS_V(c->s, vc4_nir_lower_txf_ms, c);
NIR_PASS_V(c->s, nir_lower_idiv);
- NIR_PASS_V(c->s, nir_lower_load_const_to_scalar);
vc4_optimize_nir(c->s);
- NIR_PASS_V(c->s, nir_remove_dead_variables, nir_var_local);
NIR_PASS_V(c->s, nir_convert_from_ssa, true);
if (vc4_debug & VC4_DEBUG_SHADERDB) {
fprintf(stderr, "\n");
}
+ NIR_PASS_V(s, nir_opt_global_to_local);
+ NIR_PASS_V(s, nir_convert_to_ssa);
+ NIR_PASS_V(s, nir_normalize_cubemap_coords);
+ NIR_PASS_V(s, nir_lower_load_const_to_scalar);
+
+ vc4_optimize_nir(s);
+
+ NIR_PASS_V(s, nir_remove_dead_variables, nir_var_local);
+
+ /* Garbage collect dead instructions */
+ nir_sweep(s);
+
so->base.type = PIPE_SHADER_IR_NIR;
so->base.ir.nir = s;