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