radeonsi: rewrite si_get_total_colormask as si_any_colorbuffer_written

The result is only used as bool.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
This commit is contained in:
Marek Olšák 2023-11-20 05:11:33 -05:00 committed by Marge Bot
parent e2b817b948
commit 53aa36772a
3 changed files with 10 additions and 16 deletions

View file

@ -733,7 +733,7 @@ static void si_check_render_feedback(struct si_context *sctx)
/* There is no render feedback if color writes are disabled.
* (e.g. a pixel shader with image stores)
*/
if (!si_get_total_colormask(sctx))
if (!si_any_colorbuffer_written(sctx))
return;
for (int i = 0; i < SI_NUM_GRAPHICS_SHADERS; ++i) {

View file

@ -1972,24 +1972,18 @@ static inline unsigned si_get_ps_iter_samples(struct si_context *sctx)
return MIN2(sctx->ps_iter_samples, sctx->framebuffer.nr_color_samples);
}
static inline unsigned si_get_total_colormask(struct si_context *sctx)
static inline bool si_any_colorbuffer_written(struct si_context *sctx)
{
if (sctx->queued.named.rasterizer->rasterizer_discard)
return 0;
return false;
struct si_shader_selector *ps = sctx->shader.ps.cso;
if (!ps)
return 0;
if (!ps || !ps->info.colors_written_4bit)
return false;
unsigned colormask =
sctx->framebuffer.colorbuf_enabled_4bit & sctx->queued.named.blend->cb_target_mask;
if (!ps->info.color0_writes_all_cbufs)
colormask &= ps->info.colors_written_4bit;
else if (!ps->info.colors_written_4bit)
colormask = 0; /* color0 writes all cbufs, but it's not written */
return colormask;
return (sctx->framebuffer.colorbuf_enabled_4bit &
sctx->queued.named.blend->cb_target_enabled_4bit &
(ps->info.color0_writes_all_cbufs ? ~0 : ps->info.colors_written_4bit)) != 0;
}
#define UTIL_ALL_PRIM_LINE_MODES \

View file

@ -2208,10 +2208,10 @@ void si_update_ps_inputs_read_or_disabled(struct si_context *sctx)
sctx->queued.named.dsa->alpha_func != PIPE_FUNC_ALWAYS ||
sctx->queued.named.rasterizer->poly_stipple_enable ||
sctx->queued.named.rasterizer->point_smooth;
unsigned ps_colormask = si_get_total_colormask(sctx);
ps_disabled = sctx->queued.named.rasterizer->rasterizer_discard ||
(!ps_colormask && !ps_modifies_zs && !ps->info.base.writes_memory);
(!ps_modifies_zs && !ps->info.base.writes_memory &&
!si_any_colorbuffer_written(sctx));
}
uint64_t ps_inputs_read_or_disabled;