ctx->st->has_half_float_packing);
do_mat_op_to_vec(ir);
- if (stage == MESA_SHADER_FRAGMENT && pscreen->get_param(pscreen, PIPE_CAP_FBFETCH))
- lower_blend_equation_advanced(
- shader, ctx->Extensions.KHR_blend_equation_advanced_coherent);
-
lower_instructions(ir, have_dround,
ctx->Extensions.ARB_gpu_shader5);
assert(options);
nir_shader *nir = prog->nir;
+ if (prog->info.stage == MESA_SHADER_FRAGMENT &&
+ st->screen->get_param(st->screen, PIPE_CAP_FBFETCH)) {
+ nir_shader_gather_info(prog->nir, nir_shader_get_entrypoint(prog->nir));
+ NIR_PASS_V(prog->nir, gl_nir_lower_blend_equation_advanced,
+ st->ctx->Extensions.KHR_blend_equation_advanced_coherent);
+ nir_lower_global_vars_to_local(prog->nir);
+ NIR_PASS_V(prog->nir, nir_opt_combine_stores, nir_var_shader_out);
+ }
+
/* Set the next shader stage hint for VS and TES. */
if (!nir->info.separate_shader &&
(nir->info.stage == MESA_SHADER_VERTEX ||