radeonsi/gfx11: fix alpha-to-coverage with blending

Bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8222

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23216>
This commit is contained in:
Marek Olšák 2023-05-03 11:24:41 -04:00
parent 2f6665efc5
commit dcbe4b89ea

View file

@ -567,6 +567,16 @@ static void *si_create_blend_state_mode(struct pipe_context *ctx,
S_028760_ALPHA_SRC_OPT(srcA_opt) | S_028760_ALPHA_DST_OPT(dstA_opt) |
S_028760_ALPHA_COMB_FCN(si_translate_blend_opt_function(eqA));
/* Alpha-to-coverage with blending enabled, depth writes enabled, and having no MRTZ export
* should disable SX blend optimizations.
*
* TODO: Add a piglit test for this. It should fail on gfx11 without this.
*/
if (sctx->gfx_level >= GFX11 && state->alpha_to_coverage && i == 0) {
sx_mrt_blend_opt[0] = S_028760_COLOR_COMB_FCN(V_028760_OPT_COMB_NONE) |
S_028760_ALPHA_COMB_FCN(V_028760_OPT_COMB_NONE);
}
/* Set blend state. */
blend_cntl |= S_028780_ENABLE(1);
blend_cntl |= S_028780_COLOR_COMB_FCN(si_translate_blend_function(eqRGB));