i965/vec4: nir_emit_if doesn't need to predicate based on all the channels
authorAlejandro Piñeiro <apinheiro@igalia.com>
Fri, 9 Oct 2015 14:59:20 +0000 (16:59 +0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 22 Oct 2015 19:58:03 +0000 (21:58 +0200)
v2: changed comment, as suggested by Matt Turner

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

index ea1e3e7bbcfb84bddc201b54e00722962f4248cf..0f04f65eeafc1747be2852787700f3db9d6a4571 100644 (file)
@@ -193,7 +193,9 @@ vec4_visitor::nir_emit_if(nir_if *if_stmt)
    vec4_instruction *inst = emit(MOV(dst_null_d(), condition));
    inst->conditional_mod = BRW_CONDITIONAL_NZ;
 
-   emit(IF(BRW_PREDICATE_NORMAL));
+   /* We can just predicate based on the X channel, as the condition only
+    * goes on its own line */
+   emit(IF(BRW_PREDICATE_ALIGN16_REPLICATE_X));
 
    nir_emit_cf_list(&if_stmt->then_list);