From a142bb899291ae68d00f552959cf6ee1cbb9e6c2 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Tue, 21 Apr 2020 09:05:55 -0700 Subject: [PATCH] freedreno/a6xx: skip unnecessary MRT blend state To lower CP overhead. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/a6xx/fd6_blend.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_blend.c b/src/gallium/drivers/freedreno/a6xx/fd6_blend.c index 279f9ea5512..16e2bfaf1b8 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_blend.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_blend.c @@ -78,7 +78,7 @@ __fd6_setup_blend_variant(struct fd6_blend_stateobj *blend, unsigned sample_mask ((A6XX_MAX_RENDER_TARGETS * 4) + 6) * 4); so->stateobj = ring; - for (unsigned i = 0; i < A6XX_MAX_RENDER_TARGETS; i++) { + for (unsigned i = 0; i <= cso->max_rt; i++) { const struct pipe_rt_blend_state *rt; if (cso->independent_blend_enable) @@ -162,8 +162,8 @@ fd6_blend_state_create(struct pipe_context *pctx, so->ctx = fd_context(pctx); so->lrz_write = true; /* unless blend enabled for any MRT */ - unsigned nr = cso->independent_blend_enable ? A6XX_MAX_RENDER_TARGETS : 1; - for (unsigned i = 0; i < nr; i++) { + unsigned nr = cso->independent_blend_enable ? cso->max_rt : 0; + for (unsigned i = 0; i <= nr; i++) { const struct pipe_rt_blend_state *rt = &cso->rt[i]; if (rt->blend_enable) { -- 2.30.2