[Mesa-dev] [PATCH 029/133] i965/fs_nir: Add support for sample_pos and sample_id

Jason Ekstrand jason at jlekstrand.net
Tue Dec 16 22:23:05 PST 2014


On Dec 16, 2014 10:15 PM, "Connor Abbott" <cwabbott0 at gmail.com> wrote:
>
> On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand <jason at jlekstrand.net>
wrote:
> > ---
> >  src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 17 ++++++++++++++---
> >  1 file changed, 14 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> > index 22f4c0f..677bd8f 100644
> > --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> > +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> > @@ -1328,9 +1328,20 @@
fs_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
> >        break;
> >     }
> >
> > -   case nir_intrinsic_load_sample_pos:
> > -   case nir_intrinsic_load_sample_id:
> > -      assert(!"TODO");
> > +   case nir_intrinsic_load_sample_pos: {
> > +      fs_reg *reg = emit_samplepos_setup();
> > +      dest.type = reg->type;
> > +      emit(MOV(dest, *reg));
> > +      emit(MOV(offset(dest, 1), offset(*reg, 1)));
> > +      break;
> > +   }
> > +
> > +   case nir_intrinsic_load_sample_id: {
> > +      fs_reg *reg = emit_sampleid_setup();
> > +      dest.type = reg->type;
> > +      emit(MOV(dest, *reg));
> > +      break;
> > +   }
>
> I mentioned this before, but we should be calling emit_*_setup() at
> the beginning of the shader and then just emit a MOV here... I trust
> DCE much more than CSE to Do The Right Thing here.

Probably not a bad plan
--Jason

>
> >
> >     case nir_intrinsic_load_uniform_vec1:
> >     case nir_intrinsic_load_uniform_vec2:
> > --
> > 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/20141216/5b12797b/attachment.html>


More information about the mesa-dev mailing list