[Mesa-dev] [PATCH 031/133] nir: Add fine and coarse derivative opcodes

Jason Ekstrand jason at jlekstrand.net
Wed Dec 17 08:44:41 PST 2014


On Dec 17, 2014 7:43 AM, "Connor Abbott" <cwabbott0 at gmail.com> wrote:
>
> On Wed, Dec 17, 2014 at 6:52 AM, Jason Ekstrand <jason at jlekstrand.net>
wrote:
> >
> >
> > On Tue, Dec 16, 2014 at 10:31 PM, Connor Abbott <cwabbott0 at gmail.com>
wrote:
> >>
> >> As a future cleanup, would it be worth getting rid of fddx and fddy
> >> entirely and just generating the correct variant based on the
> >> glHint/drirc configuration?
> >
> >
> > Nope.  https://www.opengl.org/registry/specs/ARB/derivative_control.txt
>
> I just meant doing the
>
> if (fs_key->high_quality_derivatives) { emit ddx_fine } else { emit
> ddx_coarse } part in NIR so other drivers don't have to handle it, I
> still don't understand why that's not possible.

Sure, we could do that but i don't think we want to.  On i965, switching
the derivative glHint forces a recompile but this may not always be the
case.  If we do have a driver that can switch on-the-fly or if as figure
out how to do it in i965 for cheap, we'll want all 6.

>
> >
> >>
> >>
> >> On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand <jason at jlekstrand.net>
> >> wrote:
> >> > ---
> >> >  src/glsl/nir/nir_opcodes.h | 4 ++++
> >> >  1 file changed, 4 insertions(+)
> >> >
> >> > diff --git a/src/glsl/nir/nir_opcodes.h b/src/glsl/nir/nir_opcodes.h
> >> > index bee4bd1..9a7a2ab 100644
> >> > --- a/src/glsl/nir/nir_opcodes.h
> >> > +++ b/src/glsl/nir/nir_opcodes.h
> >> > @@ -111,6 +111,10 @@ UNOP(fcos_reduced, nir_type_float)
> >> >  /*@{*/
> >> >  UNOP(fddx, nir_type_float)
> >> >  UNOP(fddy, nir_type_float)
> >> > +UNOP(fddx_fine, nir_type_float)
> >> > +UNOP(fddy_fine, nir_type_float)
> >> > +UNOP(fddx_coarse, nir_type_float)
> >> > +UNOP(fddy_coarse, nir_type_float)
> >> >  /*@}*/
> >> >
> >> >  /**
> >> > --
> >> > 2.2.0
> >> >
> >> > _______________________________________________
> >> > mesa-dev mailing list
> >> > mesa-dev at lists.freedesktop.org
> >> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141217/daa64d53/attachment.html>


More information about the mesa-dev mailing list