[Mesa-dev] [PATCH RFC 0/2] nir/lower_tex: Fix progress report when called in a loop

Jason Ekstrand jason at jlekstrand.net
Mon Jun 17 21:03:47 UTC 2019


On Mon, Jun 17, 2019 at 12:03 PM Boris Brezillon <
boris.brezillon at collabora.com> wrote:

> On Mon, 17 Jun 2019 10:54:20 -0500
> Jason Ekstrand <jason at jlekstrand.net> wrote:
>
> > Why do you need to call it in a loop?
>
> Well, I need to call it at least twice (first pass to lower TEX(RECT)
> into TXS(LOD)+TEX(2D) and the second pass to lower TXS(LOD) into
> TXS(0)>>LOD) and I thought doing that in a do {} while (progress) loop
> would be more future proof (in case things need to be done in more than
> 2 passes at some point).


That makes sense.  Generally, we've tried to make the pass so that it does
the right thing with one invocation but you're likely using a lowering
combination that no one has used before.


> This being said, I wasn't sure about this
> solution, hence the RFC ;-). I'm perfectly fine calling
> NIR_PASS(nir_lower_tex) twice if that's what you recommend.
>

That's fine.  If it returns progress even though it didn't touch the
shader, that's a bug.

--Jason


> >
> > On Mon, Jun 17, 2019 at 5:21 AM Boris Brezillon <
> > boris.brezillon at collabora.com> wrote:
> >
> > > Hello,
> > >
> > > I've recently been working on adding a new lowering option to the
> > > lower_tex() logic and found out that doing
> > >
> > >         do progress = nir_lower_tex(); while (progress);
> > >
> > > is not working well (nir_lower_tex() keeps returning true and lowering
> > > the same instructions over and over again).
> > >
> > > The 2 patches in this series seem to fix my issues, but I'm only using
> > > txp and rect lowering, and looking at the rest of the code I fear there
> > > are other places that could lower things twice of keep reporting that
> > > things have progressed even if it's not true (yuv to rgb conversion is
> > > of these). So, my question is, are nir_lower_tex() users supposed to
> > > clear options flags manually after this pass and limit the number
> > > of passes (through some experimenting) or should we try to fix
> > > nir_lower_tex()?
> > >
> > > Regards,
> > >
> > > Boris
> > >
> > > Boris Brezillon (2):
> > >   nir/lower_tex: Actually report when projector lowering happened
> > >   nir/lower_tex: Update ->sampler_dim value before calling
> > >     get_texture_size()
> > >
> > >  src/compiler/nir/nir_lower_tex.c | 12 ++++++------
> > >  1 file changed, 6 insertions(+), 6 deletions(-)
> > >
> > > --
> > > 2.20.1
> > >
> > >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190617/65d3b10d/attachment.html>


More information about the mesa-dev mailing list