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

Caio Marcelo de Oliveira Filho caio.oliveira at intel.com
Fri Jul 13 00:11:56 UTC 2018


On Thu, Jul 12, 2018 at 12:54:54PM -0700, Jason Ekstrand wrote:
> 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.

Got it, thanks for the explanation.


More information about the mesa-dev mailing list