<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Aug 15, 2018 at 5:36 PM Timothy Arceri <<a href="mailto:tarceri@itsqueeze.com">tarceri@itsqueeze.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 16/08/18 02:10, Jason Ekstrand wrote:<br>
> On Tue, Aug 14, 2018 at 7:25 PM Timothy Arceri <<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a> <br>
> <mailto:<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a>>> wrote:<br>
> <br>
>     On 09/08/18 05:05, Jason Ekstrand wrote:<br>
>      > Commit 4434591bf56a6b0 caused substantially more URB messages in<br>
>      > geometry and tessellation shaders.  Before we can really enable this<br>
>      > sort of optimization,  We either need some way of combining them back<br>
>      > together into vectors or we need to do cross-stage vector element<br>
>      > elimination without splitting everything into scalars.<br>
> <br>
>     You should be calling:<br>
> <br>
>     nir_compact_varyings() after remove_unused_varyings this should do most<br>
>     of what you want.<br>
> <br>
> <br>
> Does that turn things back into vectors?  The problem we're hitting is <br>
> not that things aren't compacted, it's that we want to read/write whole <br>
> vectors at a time as much as possible.  Just reverting the patch isn't <br>
> quite the proper solution because we want to be able to compact things <br>
> and it would be nice if we could load two variables at a time if they're <br>
> packed side-by-side in one vec4.  However, it does solve the perf <br>
> regression for now.<br>
<br>
Yes. nir_compact_varyings() compacts everything into vec4s. The only <br>
thing it doesn't currently do is compact the locations (the nir->llvm <br>
pass does this for radeonsi anyway).<br></blockquote><div><br></div><div>I think I was unclear.  nir_compact_varyings does pack things tightly but it doesn't turn each set of 4 scalar vars into a single vec4 var which is what we would need in order for it to fix the perf problem caused by these patches. <br></div></div></div>