<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Jul 12, 2018 at 10:28 AM Caio Marcelo de Oliveira Filho <<a href="mailto:caio.oliveira@intel.com">caio.oliveira@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> > Question: earlier in the code we call<br>
> ><br>
> >    populate_wm_prog_key(pipeline, info, &key);<br>
> ><br>
> > which does<br>
> ><br>
> >    key->nr_color_regions = pipeline->subpass->color_count;<br>
> ><br>
> >    key->replicate_alpha = key->nr_color_regions > 1 &&<br>
> >                           info->pMultisampleState &&<br>
> >                           info->pMultisampleState->alphaToCoverageEnable;<br>
> ><br>
> > so key->replicate_alpha is calculated based on the old value. Should<br>
> > this be (re)calculated using the new value?<br>
> ><br>
> <br>
> We could but it would have no effect.  100% of the uses of replicate_alpha<br>
> in the back-end have it ANDed with inst->target > 0.<br>
<br>
If it's not effectful, maybe we could remove the<br>
"key->nr_color_regions > 1 &&" from the definition of replicate_alpha<br>
then?<br></blockquote><div><br></div><div>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.<br></div></div></div>