[Mesa-dev] [PATCH] anv/gen7_pipeline: Set PixelShaderKillPixel when needed

Jason Ekstrand jason at jlekstrand.net
Fri Aug 5 18:34:45 UTC 2016


On Fri, Aug 5, 2016 at 9:51 AM, Nanley Chery <nanleychery at gmail.com> wrote:

> On Thu, Aug 04, 2016 at 08:07:08PM -0700, Jason Ekstrand wrote:
> > Drp... There's more work to do here to get the behavior 100% correct on
> > gen7 but this fixes a bug and is a step in the right direction.
> >
>
> You're right. To be more accurate, I'll rename the commit title to:
> "anv/gen7_pipeline: Set PixelShaderKillPixel for discards"
>
> > Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
>
> Thanks for the review!
>
> >
> > Unfortunately, gen7 is a bit crazy so the simple solution doesn't cover
> all
> > the cases.  For the full fix take a look at
> >
> > https://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/
> drivers/dri/i965/gen7_wm_state.c#n74
>
> It'd probably be good for me to totally hook up this field while I'm in
> the area, so I'll put it on my TODO (though I'm fine with anyone picking
> this up). I'd send out a v2 which does this, but I would need to spend a
> decent amount of time ramping up on all the interactions with this
> field.
>
> >
> > and
> >
> > https://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/
> drivers/dri/i965/gen7_wm_state.c#n81
>
> This condition seems strange. The docs seem to say:
> if (GEN7_WM_DISPATCH_ENABLE == 0)
>    GEN7_WM_KILL_ENABLE = 0;
>
> but i965 does:
> if (GEN7_WM_KILL_ENABLE == 1)
>    GEN7_WM_DISPATCH_ENABLE = 1;
>
> >
> > and maybe
> >
> > https://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/
> drivers/dri/i965/gen7_wm_state.c#n119
>
> I don't understand how this field is related.
>

I'm not sure it is actually related.  We do need to make sure we're setting
it correctly, but we can do that later.


>
> - Nanley
>
> >
> > --Jason
> >
> > On Aug 4, 2016 4:45 PM, "Nanley Chery" <nanleychery at gmail.com> wrote:
> >
> > > According to the IVB PRM Vol2 P1, this bit must be set if a pixel
> shader
> > > contains a discard instruction.
> > >
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97207
> > > Cc: "12.0" <mesa-stable at lists.freedesktop.org>
> > > Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> > > ---
> > >  src/intel/vulkan/gen7_pipeline.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/src/intel/vulkan/gen7_pipeline.c b/src/intel/vulkan/gen7_
> > > pipeline.c
> > > index 8ce50be..d1b18e0 100644
> > > --- a/src/intel/vulkan/gen7_pipeline.c
> > > +++ b/src/intel/vulkan/gen7_pipeline.c
> > > @@ -297,6 +297,7 @@ genX(graphics_pipeline_create)(
> > >           wm.LineEndCapAntialiasingRegionWidth   = 0; /* 0.5 pixels */
> > >           wm.LineAntialiasingRegionWidth         = 1; /* 1.0 pixels */
> > >           wm.PointRasterizationRule              =
> RASTRULE_UPPER_RIGHT;
> > > +         wm.PixelShaderKillPixel                =
> wm_prog_data->uses_kill;
> > >           wm.PixelShaderComputedDepthMode        =
> > > wm_prog_data->computed_depth_mode;
> > >           wm.PixelShaderUsesSourceDepth          =
> > > wm_prog_data->uses_src_depth;
> > >           wm.PixelShaderUsesSourceW              =
> > > wm_prog_data->uses_src_w;
> > > --
> > > 2.9.0
> > >
> > > _______________________________________________
> > > mesa-dev mailing list
> > > mesa-dev at lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> > >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160805/d205294d/attachment-0001.html>


More information about the mesa-dev mailing list