Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-21 Thread Marek Olšák
On Mon, Oct 21, 2019 at 5:37 AM Erik Faye-Lund wrote: > On Fri, 2019-10-18 at 18:23 -0400, Marek Olšák wrote: > > Oh BTW, drivers that want to implement pipe_screen::finalize_nir to > > improve cached shader compilation can't use any of those lowering > > passes, because then things blow up. > >

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-21 Thread Erik Faye-Lund
On Fri, 2019-10-18 at 18:23 -0400, Marek Olšák wrote: > Oh BTW, drivers that want to implement pipe_screen::finalize_nir to > improve cached shader compilation can't use any of those lowering > passes, because then things blow up. Two questions: 1. What is pipe_screen::finalize_nir? I can't see t

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-21 Thread Erik Faye-Lund
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 pr

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-18 Thread Rob Clark
hmm, initially the UCP lowering did work post var lowering (since it had work after tgsi_to_nir).. the same might not be true of the drawpix/wpos_ytransform/etc lowering that is used internally in mesa/st for variants. I assume something like this is the issue? BR, -R On Fri, Oct 18, 2019 at 3:2

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-18 Thread Marek Olšák
Oh BTW, drivers that want to implement pipe_screen::finalize_nir to improve cached shader compilation can't use any of those lowering passes, because then things blow up. The only _optional_ lowering you can do in st/mesa is clamp_color and force_persample_in_shader, which covers iris at least (rad

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-18 Thread Marek Olšák
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. On the other hand, having multiple shader variants in st/mesa is a performance disadvantage. The lowering should be

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-18 Thread Marek Olšák
On Fri, Oct 18, 2019 at 9:07 AM Ilia Mirkin wrote: > On Fri, Oct 18, 2019 at 9:04 AM Erik Faye-Lund > 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 > > > wrote: > > > > On Thu, 2019-10-17 at 22:24 -0400, Ilia Mirkin wro

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-18 Thread Ilia Mirkin
On Fri, Oct 18, 2019 at 9:07 AM Ilia Mirkin wrote: > > On Fri, Oct 18, 2019 at 9:04 AM Erik Faye-Lund > 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 > > > wrote: > > > > On Thu, 2019-10-17 at 22:24 -0400, Ilia Mirkin wr

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-18 Thread Ilia Mirkin
On Fri, Oct 18, 2019 at 9:04 AM Erik Faye-Lund 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 > > wrote: > > > On Thu, 2019-10-17 at 22:24 -0400, Ilia Mirkin wrote: > > > > In the meanwhile (unless you plan on taking up Jason's

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-18 Thread Erik Faye-Lund
On Fri, 2019-10-18 at 08:57 -0400, Ilia Mirkin wrote: > On Fri, Oct 18, 2019 at 8:51 AM Erik Faye-Lund > 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 un

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-18 Thread Erik Faye-Lund
On Thu, 2019-10-17 at 20:55 -0500, Jason Ekstrand wrote: > On Thu, Oct 17, 2019 at 10:39 AM Erik Faye-Lund < > erik.faye-l...@collabora.com> wrote: > > This is discussed in the merge request thread. Zink currently only > > support vertex and fragment shaders, so it's the only place this > > can occ

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-18 Thread Ilia Mirkin
On Fri, Oct 18, 2019 at 8:51 AM Erik Faye-Lund 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 s

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-18 Thread Erik Faye-Lund
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/merg

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-17 Thread Ilia Mirkin
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? Cheers, -ilia On Thu, Oct 17, 2019 at 11:39 AM Erik Faye-Lund wrote: > > This is discussed in the merge request thread. Zink currently on

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-17 Thread Jason Ekstrand
On Thu, Oct 17, 2019 at 10:39 AM Erik Faye-Lund < erik.faye-l...@collabora.com> wrote: > This is discussed in the merge request thread. Zink currently only support > vertex and fragment shaders, so it's the only place this can occur. If > someone wants to enable this for drivers that supports geom

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-17 Thread Erik Faye-Lund
This is discussed in the merge request thread. Zink currently only support vertex and fragment shaders, so it's the only place this can occur. If someone wants to enable this for drivers that supports geometry or tesselation shaders, they would need to extend this code first. Unless I beat them

Re: [Mesa-dev] mesa/st: support lowering user-clip-planes automatically

2019-10-17 Thread Ilia Mirkin
Hey Erik, Just saw your change https://cgit.freedesktop.org/mesa/mesa/commit/?id=3298aedd6e9f12cefd5aa7414eeebf69ce7538d1 . It looks like you assume that the UCPs will apply in the vertex stage, but given that we support GL compat profiles for GL 4.0+ in st/mesa, the UCPs actually apply to the sam