[Mesa-stable] [PATCH 2/2] i965: Set ForceZeroRTAIndexEnable based on slots_valid

Jason Ekstrand jason at jlekstrand.net
Thu Nov 8 21:38:51 UTC 2018


On Thu, Nov 8, 2018 at 9:32 AM Emil Velikov <emil.l.velikov at gmail.com>
wrote:

> Hi Jason,
>
> On Sat, 27 Oct 2018 at 22:35, Jason Ekstrand <jason at jlekstrand.net> wrote:
> >
> > Instead of setting it based on the number of layers in the framebuffer,
> > disable it whenever the shader does not explicitly write the value.
> > Otherwise, if the shader doesn't write the value but you do have a
> > layered framebuffer, we may end up with a garbage layer and write off
> > into the ether.
> >
> > https://bugs.freedesktop.org/show_bug.cgi?id=108571
> > Cc: mesa-stable at lists.freedesktop.org
> > ---
> >  src/mesa/drivers/dri/i965/genX_state_upload.c | 7 +++----
> >  1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c
> b/src/mesa/drivers/dri/i965/genX_state_upload.c
> > index 56fa5969725..d4915e86e9b 100644
> > --- a/src/mesa/drivers/dri/i965/genX_state_upload.c
> > +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
> > @@ -1458,7 +1458,6 @@ genX(upload_clip_state)(struct brw_context *brw)
> >     struct brw_wm_prog_data *wm_prog_data =
> >        brw_wm_prog_data(brw->wm.base.prog_data);
> >
> > -#if GEN_GEN < 8
> >     /* BRW_NEW_VS_PROG_DATA | BRW_NEW_TES_PROG_DATA |
> BRW_NEW_GS_PROG_DATA */
> >     const struct brw_vue_prog_data *vue_prog_data;
> >     if (brw->gs.base.prog_data)
> > @@ -1467,7 +1466,6 @@ genX(upload_clip_state)(struct brw_context *brw)
> >        vue_prog_data = brw_vue_prog_data(brw->tes.base.prog_data);
> >     else
> >        vue_prog_data = brw_vue_prog_data(brw->vs.base.prog_data);
> > -#endif
> >
> >     brw_batch_emit(brw, GENX(3DSTATE_CLIP), clip) {
> >        clip.StatisticsEnable = !brw->meta_in_progress;
> > @@ -1561,8 +1559,9 @@ genX(upload_clip_state)(struct brw_context *brw)
> >        clip.MinimumPointWidth = 0.125;
> >        clip.MaximumPointWidth = 255.875;
> >        clip.MaximumVPIndex = viewport_count - 1;
> > -      if (_mesa_geometric_layers(fb) == 0)
> > -         clip.ForceZeroRTAIndexEnable = true;
> > +      clip.ForceZeroRTAIndexEnable =
> > +         _mesa_geometric_layers(fb) == 0 ||
> > +         !(vue_prog_data->vue_map.slots_valid & VARYING_BIT_LAYER);
> >     }
> >  }
> >
> > --
> What the status here - did this patch fall through the cracks, is
> lacking review, other?
>

Ken and I decided that it's the right thing to do and it probably fixes a
bug but Ken hasn't reviewed it formally yet.

--Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20181108/495ea81a/attachment.html>


More information about the mesa-stable mailing list