intel/compiler/icl: Use barrier id bits 24:30 instead of 24:27,31
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 20 Sep 2018 10:46:04 +0000 (06:46 -0400)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Tue, 25 Sep 2018 06:59:59 +0000 (09:59 +0300)
Fixes gpu hangs with Carchase and Manhattan.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/compiler/brw_fs_visitor.cpp

index cd2abbb596070fd8a10cc6af6dc8365468033e0d..51a0ca2374a8bead32b35813c003663b59cceb4c 100644 (file)
@@ -791,9 +791,19 @@ fs_visitor::emit_cs_terminate()
 void
 fs_visitor::emit_barrier()
 {
-   assert(devinfo->gen >= 7);
-   const uint32_t barrier_id_mask =
-      devinfo->gen >= 9 ? 0x8f000000u : 0x0f000000u;
+   uint32_t barrier_id_mask;
+   switch (devinfo->gen) {
+   case 7:
+   case 8:
+      barrier_id_mask = 0x0f000000u; break;
+   case 9:
+   case 10:
+      barrier_id_mask = 0x8f000000u; break;
+   case 11:
+      barrier_id_mask = 0x7f000000u; break;
+   default:
+      unreachable("barrier is only available on gen >= 7");
+   }
 
    /* We are getting the barrier ID from the compute shader header */
    assert(stage == MESA_SHADER_COMPUTE);