i965/ir: Pass identity mask to brw_find_live_channel() in the packed dispatch case.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 16 Sep 2016 00:24:10 +0000 (17:24 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 21 Sep 2016 10:45:46 +0000 (13:45 +0300)
This avoids emitting a few extra instructions required to take the
dispatch mask into account when it's known to be tightly packed.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp

index c510f4283696f79cb34f7c0a17849de301e5929f..842e1253f280a57eafee3b735748e8b745bdc35a 100644 (file)
@@ -2045,7 +2045,10 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
 
       case SHADER_OPCODE_FIND_LIVE_CHANNEL: {
          const struct brw_reg mask =
-            stage == MESA_SHADER_FRAGMENT ? brw_vmask_reg() : brw_dmask_reg();
+            brw_stage_has_packed_dispatch(devinfo, stage,
+                                          prog_data) ? brw_imm_ud(~0u) :
+            stage == MESA_SHADER_FRAGMENT ? brw_vmask_reg() :
+            brw_dmask_reg();
          brw_find_live_channel(p, dst, mask);
          break;
       }
index f9e6d1c156f03d978dabca7c71c44e445546fadd..163cf9dcdd07f882623adcaff1676b52274df38d 100644 (file)
@@ -1862,9 +1862,14 @@ generate_code(struct brw_codegen *p,
          brw_memory_fence(p, dst);
          break;
 
-      case SHADER_OPCODE_FIND_LIVE_CHANNEL:
-         brw_find_live_channel(p, dst, brw_dmask_reg());
+      case SHADER_OPCODE_FIND_LIVE_CHANNEL: {
+         const struct brw_reg mask =
+            brw_stage_has_packed_dispatch(devinfo, nir->stage,
+                                          &prog_data->base) ? brw_imm_ud(~0u) :
+            brw_dmask_reg();
+         brw_find_live_channel(p, dst, mask);
          break;
+      }
 
       case SHADER_OPCODE_BROADCAST:
          assert(inst->force_writemask_all);