<div dir="ltr">I just reverted this in master because it regressed about 30K Vulkan CTS tests.  More investigation needed?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 13, 2018 at 2:07 AM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tuesday, June 12, 2018 1:38:03 PM PDT Rafael Antognolli wrote:<br>
> On Mon, Jun 11, 2018 at 02:01:49PM -0700, Kenneth Graunke wrote:<br>
> > The UBO push analysis pass incorrectly assumed that all values would fit<br>
> > within a 32B chunk, and only recorded a bit for the 32B chunk containing<br>
> > the starting offset.<br>
> > <br>
> > For example, if a UBO contained the following, tightly packed:<br>
> > <br>
> >    vec4 a;  // [0, 16)<br>
> >    float b; // [16, 20)<br>
> >    vec4 c;  // [20, 36)<br>
> > <br>
> > then, c would start at offset 20 / 32 = 0 and end at 36 / 32 = 1,<br>
> > which means that we ought to record two 32B chunks in the bitfield.<br>
> > <br>
> > Similarly, dvec4s would suffer from the same problem.<br>
> > ---<br>
> >  src/intel/compiler/brw_nir_<wbr>analyze_ubo_ranges.c | 8 +++++++-<br>
> >  1 file changed, 7 insertions(+), 1 deletion(-)<br>
> > <br>
> > diff --git a/src/intel/compiler/brw_nir_<wbr>analyze_ubo_ranges.c b/src/intel/compiler/brw_nir_<wbr>analyze_ubo_ranges.c<br>
> > index d58fe3dd2e3..6d6ccf73ade 100644<br>
> > --- a/src/intel/compiler/brw_nir_<wbr>analyze_ubo_ranges.c<br>
> > +++ b/src/intel/compiler/brw_nir_<wbr>analyze_ubo_ranges.c<br>
> > @@ -141,10 +141,16 @@ analyze_ubos_block(struct ubo_analysis_state *state, nir_block *block)<br>
> >           if (offset >= 64)<br>
> >              continue;<br>
> >  <br>
> > +         /* The value might span multiple 32-byte chunks. */<br>
> > +         const int bytes = nir_intrinsic_dest_components(<wbr>intrin) *<br>
> > +                           (nir_dest_bit_size(intrin-><wbr>dest) / 8);<br>
> > +         const int end = DIV_ROUND_UP(offset_const-><wbr>u32[0] + bytes, 32);<br>
> > +         const int regs = end - offset + 1;<br>
> > +<br>
> <br>
> But if I understood it correctly, offset is the first 32B chunk within<br>
> the UBO block (it's actually an ubo "chunk offset"). And you calculate<br>
> bytes by taking the number of components times the size of each<br>
> component of the nir_intrinsic_load_ubo instruction (which apparently<br>
> supports multiple components). So yeah, this makes sense to me.<br>
<br>
</div></div>Yeah, that's exactly right.  load_ubo can load up to 4 components.<br>
<span class=""><br>
> Take this review with a grain of salt (assuming what I wrote above is<br>
> correct), but this looks simple enough. So it is<br>
> <br>
> Reviewed-by: Rafael Antognolli <<a href="mailto:rafael.antognolli@intel.com">rafael.antognolli@intel.com</a>><br>
<br>
</span>Thanks!<br>
<br>______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
<br></blockquote></div><br></div>