mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
radeonsi/gfx11: don't add alpha to mrt0 format for A2C if exporting via mrtz
If alpha-to-coverage is exported via mrtz, don't upgrade the mrt0 format to one with an alpha channel. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
This commit is contained in:
parent
0f81224e70
commit
97f30fc65f
2 changed files with 11 additions and 7 deletions
|
|
@ -489,9 +489,6 @@ static void *si_create_blend_state_mode(struct pipe_context *ctx,
|
|||
S_028B70_OFFSET_ROUND(0));
|
||||
}
|
||||
|
||||
if (state->alpha_to_coverage)
|
||||
blend->need_src_alpha_4bit |= 0xf;
|
||||
|
||||
blend->cb_target_mask = 0;
|
||||
blend->cb_target_enabled_4bit = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -2286,6 +2286,7 @@ void si_ps_key_update_framebuffer_blend_rasterizer(struct si_context *sctx)
|
|||
struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
|
||||
bool alpha_to_coverage = blend->alpha_to_coverage && rs->multisample_enable &&
|
||||
sctx->framebuffer.nr_samples >= 2;
|
||||
unsigned need_src_alpha_4bit = blend->need_src_alpha_4bit;
|
||||
|
||||
if (!sel)
|
||||
return;
|
||||
|
|
@ -2295,17 +2296,23 @@ void si_ps_key_update_framebuffer_blend_rasterizer(struct si_context *sctx)
|
|||
sctx->gfx_level >= GFX11 && alpha_to_coverage &&
|
||||
(sel->info.writes_z || sel->info.writes_stencil || sel->info.writes_samplemask);
|
||||
|
||||
/* If alpha-to-coverage isn't exported via MRTZ, set that we need to export alpha
|
||||
* through MRT0.
|
||||
*/
|
||||
if (alpha_to_coverage && !key->ps.part.epilog.alpha_to_coverage_via_mrtz)
|
||||
need_src_alpha_4bit |= 0xf;
|
||||
|
||||
/* Select the shader color format based on whether
|
||||
* blending or alpha are needed.
|
||||
*/
|
||||
key->ps.part.epilog.spi_shader_col_format =
|
||||
(blend->blend_enable_4bit & blend->need_src_alpha_4bit &
|
||||
(blend->blend_enable_4bit & need_src_alpha_4bit &
|
||||
sctx->framebuffer.spi_shader_col_format_blend_alpha) |
|
||||
(blend->blend_enable_4bit & ~blend->need_src_alpha_4bit &
|
||||
(blend->blend_enable_4bit & ~need_src_alpha_4bit &
|
||||
sctx->framebuffer.spi_shader_col_format_blend) |
|
||||
(~blend->blend_enable_4bit & blend->need_src_alpha_4bit &
|
||||
(~blend->blend_enable_4bit & need_src_alpha_4bit &
|
||||
sctx->framebuffer.spi_shader_col_format_alpha) |
|
||||
(~blend->blend_enable_4bit & ~blend->need_src_alpha_4bit &
|
||||
(~blend->blend_enable_4bit & ~need_src_alpha_4bit &
|
||||
sctx->framebuffer.spi_shader_col_format);
|
||||
key->ps.part.epilog.spi_shader_col_format &= blend->cb_target_enabled_4bit;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue