<div dir="ltr"><div>The crashes should be fixed in mesa/master.<br><br></div>Marek<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 12, 2018 at 9:17 PM, Timothy Arceri <span dir="ltr"><<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 13/04/18 10:45, Timothy Arceri wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This change cause around 20+ piglit crashes on my Polaris.<br>
<br>
e.g tests/spec/arb_compute_shader/<wbr>execution/atomic-counter.shade<wbr>r_test<br>
<br>
Thread 1 "shader_runner" received signal SIGSEGV, Segmentation fault.<br>
0x00007ffff1009ccc in si_get_total_colormask (sctx=0x64b140) at si_pipe.h:945<br>
945        if (sctx->queued.named.rasterizer<wbr>->rasterizer_discard)<br>
<br>
<br>
It also seems to cause hundreds of test failures e.g<br>
<br>
./bin/copyteximage CUBE -auto<br>
<br>
<br>
Unfortunately it doesn't revert cleanly either.<br>
</blockquote>
<br></span>
Actually ignore this second problem I'm seeing a lot of intermittent test failures. These are being caused by something else, however the<br>
crash above is caused by this commit.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-2434516758828751025h5">
<br>
On 04/04/18 11:59, Marek Olšák wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
<br>
The previous patch is required for this.<br>
---<br>
  src/gallium/drivers/radeonsi/s<wbr>i_blit.c          |  5 +++++<br>
  src/gallium/drivers/radeonsi/s<wbr>i_pipe.h          | 17 +++++++++++++++++<br>
  src/gallium/drivers/radeonsi/s<wbr>i_state_shaders.c |  6 +-----<br>
  3 files changed, 23 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/gallium/drivers/radeonsi<wbr>/si_blit.c b/src/gallium/drivers/radeonsi<wbr>/si_blit.c<br>
index 45770b0d9bf..8dd8bc2a4dd 100644<br>
--- a/src/gallium/drivers/radeonsi<wbr>/si_blit.c<br>
+++ b/src/gallium/drivers/radeonsi<wbr>/si_blit.c<br>
@@ -706,20 +706,25 @@ static void si_check_render_feedback_resid<wbr>ent_images(struct si_context *sctx)<br>
          si_check_render_feedback_textu<wbr>re(sctx, tex,<br>
                           view->u.tex.level,<br>
                           view->u.tex.level,<br>
                           view->u.tex.first_layer,<br>
                           view->u.tex.last_layer);<br>
      }<br>
  }<br>
  static void si_check_render_feedback(struc<wbr>t si_context *sctx)<br>
  {<br>
+    /* There is no render feedback if color writes are disabled.<br>
+     * (e.g. a pixel shader with image stores)<br>
+     */<br>
+    if (!si_get_total_colormask(sctx)<wbr>)<br>
+        return;<br>
      if (!sctx->need_check_render_feed<wbr>back)<br>
          return;<br>
      for (int i = 0; i < SI_NUM_SHADERS; ++i) {<br>
          si_check_render_feedback_image<wbr>s(sctx, &sctx->images[i]);<br>
          si_check_render_feedback_textu<wbr>res(sctx, &sctx->samplers[i]);<br>
      }<br>
      si_check_render_feedback_resid<wbr>ent_images(sctx);<br>
diff --git a/src/gallium/drivers/radeonsi<wbr>/si_pipe.h b/src/gallium/drivers/radeonsi<wbr>/si_pipe.h<br>
index e3d45ef6c3b..e65c946d186 100644<br>
--- a/src/gallium/drivers/radeonsi<wbr>/si_pipe.h<br>
+++ b/src/gallium/drivers/radeonsi<wbr>/si_pipe.h<br>
@@ -933,11 +933,28 @@ vi_tc_compat_htile_enabled(str<wbr>uct r600_texture *tex, unsigned level)<br>
  }<br>
  static inline unsigned si_get_ps_iter_samples(struct si_context *sctx)<br>
  {<br>
      if (sctx->ps_uses_fbfetch)<br>
          return sctx->framebuffer.nr_samples;<br>
      return sctx->ps_iter_samples;<br>
  }<br>
+static inline unsigned si_get_total_colormask(struct si_context *sctx)<br>
+{<br>
+    if (sctx->queued.named.rasterizer<wbr>->rasterizer_discard)<br>
+        return 0;<br>
+<br>
+    struct si_shader_selector *ps = sctx->ps_shader.cso;<br>
+    unsigned colormask = sctx->framebuffer.colorbuf_ena<wbr>bled_4bit &<br>
+                 sctx->queued.named.blend->cb_t<wbr>arget_mask;<br>
+<br>
+    if (!ps->info.properties[TGSI_PRO<wbr>PERTY_FS_COLOR0_WRITES_ALL_CBU<wbr>FS])<br>
+        colormask &= ps->colors_written_4bit;<br>
+    else if (!ps->colors_written_4bit)<br>
+        colormask = 0; /* color0 writes all cbufs, but it's not written */<br>
+<br>
+    return colormask;<br>
+}<br>
+<br>
  #endif<br>
diff --git a/src/gallium/drivers/radeonsi<wbr>/si_state_shaders.c b/src/gallium/drivers/radeonsi<wbr>/si_state_shaders.c<br>
index d7742eafb04..f2d29e40744 100644<br>
--- a/src/gallium/drivers/radeonsi<wbr>/si_state_shaders.c<br>
+++ b/src/gallium/drivers/radeonsi<wbr>/si_state_shaders.c<br>
@@ -1208,25 +1208,21 @@ static void si_shader_selector_key_hw_vs(s<wbr>truct si_context *sctx,<br>
      bool ps_disabled = true;<br>
      if (ps) {<br>
          const struct si_state_blend *blend = sctx->queued.named.blend;<br>
          bool alpha_to_coverage = blend && blend->alpha_to_coverage;<br>
          bool ps_modifies_zs = ps->info.uses_kill ||<br>
                        ps->info.writes_z ||<br>
                        ps->info.writes_stencil ||<br>
                        ps->info.writes_samplemask ||<br>
                        alpha_to_coverage ||<br>
                        si_get_alpha_test_func(sctx) != PIPE_FUNC_ALWAYS;<br>
-<br>
-        unsigned ps_colormask = sctx->framebuffer.colorbuf_ena<wbr>bled_4bit &<br>
-                    sctx->queued.named.blend->cb_t<wbr>arget_mask;<br>
-        if (!ps->info.properties[TGSI_PRO<wbr>PERTY_FS_COLOR0_WRITES_ALL_CBU<wbr>FS])<br>
-            ps_colormask &= ps->colors_written_4bit;<br>
+        unsigned ps_colormask = si_get_total_colormask(sctx);<br>
          ps_disabled = sctx->queued.named.rasterizer-<wbr>>rasterizer_discard ||<br>
                    (!ps_colormask &&<br>
                     !ps_modifies_zs &&<br>
                     !ps->info.writes_memory);<br>
      }<br>
      /* Find out which VS outputs aren't used by the PS. */<br>
      uint64_t outputs_written = vs->outputs_written;<br>
      uint64_t inputs_read = 0;<br>
<br>
</blockquote></div></div>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote>
</blockquote></div><br></div></div>