[Mesa-dev] mesa/st: support lowering user-clip-planes automatically
Erik Faye-Lund
erik.faye-lund at collabora.com
Mon Oct 21 09:22:28 UTC 2019
On Fri, 2019-10-18 at 16:17 -0400, Marek Olšák wrote:
> Note that none of the lowering passes work if I enable them on
> radeonsi. So if you think about enabling them for your driver, I
> guess you have some work to do in the driver as well.
Hmm, that's not the intention. The idea is that these produce the same
code as if you just wrote the relevant glsl-code... Any pointers to
what goes wrong would be great if anyone can spot it.
> On the other hand, having multiple shader variants in st/mesa is a
> performance disadvantage. The lowering should be done at the machine-
> level assembly code, so that you don't have to completely recompile
> from a higher-level IR.
That depends on how often or if at all the variants gets compiled. In
fact, we might be able to generate faster shader-code by doing this
before optimizing. I guess looking at real-world benchmarks would tell
us what the best solution is.
...But for Zink, there isn't really much of an option do this on a low-
level; the lowest level we have is SPIR-V, and we're going pretty
directly from NIR to SPIR-V; we don't have a low-level IR. We leave
that up to the Vulkan driver.
> Marek
>
> On Fri, Oct 18, 2019 at 4:08 PM Marek Olšák <maraeo at gmail.com> wrote:
> > On Fri, Oct 18, 2019 at 9:07 AM Ilia Mirkin <imirkin at alum.mit.edu>
> > wrote:
> > > On Fri, Oct 18, 2019 at 9:04 AM Erik Faye-Lund
> > > <erik.faye-lund at collabora.com> wrote:
> > > >
> > > > On Fri, 2019-10-18 at 08:57 -0400, Ilia Mirkin wrote:
> > > > > On Fri, Oct 18, 2019 at 8:51 AM Erik Faye-Lund
> > > > > <erik.faye-lund at collabora.com> wrote:
> > > > > > On Thu, 2019-10-17 at 22:24 -0400, Ilia Mirkin wrote:
> > > > > > > In the meanwhile (unless you plan on taking up Jason's
> > > > > > > suggestion),
> > > > > > > might I recommend some assert's for the unhandled cases
> > > so that
> > > > > > > there
> > > > > > > are no surprises?
> > > > > >
> > > > > > Good idea. I sent a MR for it here:
> > > > > >
> > > > > >
> > > https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2380
> > > > >
> > > > > Not sure that approach works, esp with SSO.
> > > >
> > > > If so, wouldn't that already be a problem with the existing
> > > > lower_depth_clamp-stuff, then? I mean, I just lifted the logic
> > > from
> > > > there...
> > >
> > > Yeah, that looks bogus. I'm moderately sure that checking
> > > "st->vp/gp/tep" at LinkShader time is wrong. Marek can probably
> > > confirm.
> >
> > Don't read any context states at link time. It's wrong.
> >
> > Marek
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list