[Mesa-dev] [PATCH] anv: Restrict the nuber of color regions to those actually written

Jason Ekstrand jason at jlekstrand.net
Thu Jul 12 19:54:54 UTC 2018


On Thu, Jul 12, 2018 at 10:28 AM Caio Marcelo de Oliveira Filho <
caio.oliveira at intel.com> wrote:

> > > Question: earlier in the code we call
> > >
> > >    populate_wm_prog_key(pipeline, info, &key);
> > >
> > > which does
> > >
> > >    key->nr_color_regions = pipeline->subpass->color_count;
> > >
> > >    key->replicate_alpha = key->nr_color_regions > 1 &&
> > >                           info->pMultisampleState &&
> > >
>  info->pMultisampleState->alphaToCoverageEnable;
> > >
> > > so key->replicate_alpha is calculated based on the old value. Should
> > > this be (re)calculated using the new value?
> > >
> >
> > We could but it would have no effect.  100% of the uses of
> replicate_alpha
> > in the back-end have it ANDed with inst->target > 0.
>
> If it's not effectful, maybe we could remove the
> "key->nr_color_regions > 1 &&" from the definition of replicate_alpha
> then?
>

We could but that might result in more cache misses.  By setting it to
false when nr_color_regions <= 1, we avoid extra cache misses of you
compile the same single-output shader twice once with alphaToCoverage and
once without.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180712/f92dfa2f/attachment.html>


More information about the mesa-dev mailing list