Fix all_mrt_write_mask when independent_blend_enable is false.
Otherwise, lrz write is always diabled with MRT when
independent_blend_enable is false. This fixes a 2% perf regression for
multiple gfxbench benchmarks.
Fixes:
0132c22de75 ("freedreno/a6xx: Don't disable LRZ for invalid channels")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20254>
STATIC_ASSERT((4 * PIPE_MAX_COLOR_BUFS) == (8 * sizeof(so->all_mrt_write_mask)));
so->all_mrt_write_mask = 0;
- 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];
+ for (unsigned i = 0; i <= cso->max_rt; i++) {
+ const struct pipe_rt_blend_state *rt =
+ &cso->rt[cso->independent_blend_enable ? i : 0];
so->reads_dest |= rt->blend_enable;