glsl: call nir version of lower_blend_equation_advanced()

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22711>
This commit is contained in:
Timothy Arceri 2023-04-19 22:07:32 +10:00 committed by Marge Bot
parent 7f3f429308
commit c02252950c
2 changed files with 9 additions and 4 deletions

View file

@ -81,10 +81,6 @@ link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
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);

View file

@ -339,6 +339,15 @@ st_nir_preprocess(struct st_context *st, struct gl_program *prog,
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 ||