<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 26, 2016 at 8:46 PM, Francisco Jerez <span dir="ltr"><<a href="mailto:currojerez@riseup.net" target="_blank">currojerez@riseup.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
 src/mesa/drivers/dri/i965/brw_fs.cpp | 26 ++++++++++++++++++++++++++<br>
 1 file changed, 26 insertions(+)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
index 1f3b23b..7002346 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
@@ -6547,6 +6547,32 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data,<br>
       }<br>
    }<br>
<br>
+   fs_visitor v32(compiler, log_data, mem_ctx, key, &prog_data->base,<br>
+                 NULL, /* Never used in core profile */<br>
+                 shader, 32, shader_time_index);<br>
+   if (!fail_msg && v8.max_dispatch_width >= 32 &&<br>
+       simd_required == 32) {<br></blockquote><div><br></div><div>I don't see where simd_required is getting aligned up to a power-of-two so how are we expecting to hit this?  Also, I took a look at the SIMD16 case above, and we're hand-rolling simd_required there (which we shouldn't be).  Here's what I would suggest:<br><br></div><div>simd_required = DIV_ROUND_UP(...)<br></div><div>min_simd = 32<br><br></div><div>then, in each one we do<br><br></div><div>if ((INTEL_DEBUG & DEBUG_NO16) && simd_required <= 16 && min_simd >= 16) {<br></div><div>    if (min_simd == 8)<br></div><div>        v16.import_uniforms(v8)<br></div><div>    if (!v16.run_cs()) {<br></div><div>        /* fail */<br></div><div>    } else {<br></div><div>        /* success */<br></div><div>        min_simd = MIN2(min_simd, 16);<br>    }<br>}<br><br></div><div>with the obvious adjustments for 8 and 32.  That way no8 and no16 both work fine and we properly guarantee that we compile exactly one shader.<br><br></div><div>Seem reasonable?<br><br></div><div>--Jason</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+      /* Try a SIMD32 compile */<br>
+      if (simd_required <= 8)<br>
+         v32.import_uniforms(&v8);<br>
+      else if (simd_required <= 16)<br>
+         v32.import_uniforms(&v16);<br>
+<br>
+      if (!v32.run_cs()) {<br>
+         compiler->shader_perf_log(log_data,<br>
+                                   "SIMD32 shader failed to compile: %s",<br>
+                                   v16.fail_msg);<br>
+         if (!cfg) {<br>
+            fail_msg =<br>
+               "Couldn't generate SIMD32 program and not "<br>
+               "enough threads for SIMD16";<br>
+         }<br>
+      } else {<br>
+         cfg = v32.cfg;<br>
+         prog_data->simd_size = 32;<br>
+      }<br>
+   }<br>
+<br>
    if (unlikely(cfg == NULL)) {<br>
       assert(fail_msg);<br>
       if (error_str)<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.3<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">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/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>