v3d: Always lower frag color

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35820>
This commit is contained in:
Ella Stanforth 2025-07-08 21:58:27 +01:00 committed by Marge Bot
parent dfbf1a8e80
commit ee48e81b26
2 changed files with 4 additions and 7 deletions

View file

@ -2460,8 +2460,7 @@ ntq_setup_outputs(struct v3d_compile *c)
switch (var->data.location) { switch (var->data.location) {
case FRAG_RESULT_COLOR: case FRAG_RESULT_COLOR:
for (int i = 0; i < V3D_MAX_DRAW_BUFFERS; i++) UNREACHABLE("Frag color should be lowered");
c->output_color_var[i] = var;
break; break;
case FRAG_RESULT_DATA0: case FRAG_RESULT_DATA0:
case FRAG_RESULT_DATA1: case FRAG_RESULT_DATA1:

View file

@ -361,11 +361,9 @@ v3d_uncompiled_shader_create(struct pipe_context *pctx,
if (s->info.stage == MESA_SHADER_FRAGMENT && if (s->info.stage == MESA_SHADER_FRAGMENT &&
s->info.outputs_written & BITFIELD_BIT(FRAG_RESULT_COLOR)) { s->info.outputs_written & BITFIELD_BIT(FRAG_RESULT_COLOR)) {
/* We only support one attachment when doing dual source blending. */ /* We only support one attachment when doing dual source blending. */
if (s->info.fs.color_is_dual_source) unsigned max_rb = s->info.fs.color_is_dual_source ?
NIR_PASS(_, s, nir_lower_fragcolor, 1); 1 : V3D_MAX_DRAW_BUFFERS;
else if (V3D_DBG(SOFT_BLEND)) NIR_PASS(_, s, nir_lower_fragcolor, max_rb);
NIR_PASS(_, s, nir_lower_fragcolor,
V3D_MAX_DRAW_BUFFERS);
} }
if (s->info.stage != MESA_SHADER_VERTEX && if (s->info.stage != MESA_SHADER_VERTEX &&