Mesa (master): i965/vec4: nir_emit_if doesn' t need to predicate based on all the channels

Alejandro Pinheiro apinheiro at kemper.freedesktop.org
Thu Oct 22 19:58:22 UTC 2015


Module: Mesa
Branch: master
Commit: 8ac3b525c77cb5aae9e61bd984b78f6cbbffdc1c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ac3b525c77cb5aae9e61bd984b78f6cbbffdc1c

Author: Alejandro Piñeiro <apinheiro at igalia.com>
Date:   Fri Oct  9 16:59:20 2015 +0200

i965/vec4: nir_emit_if doesn't need to predicate based on all the channels

v2: changed comment, as suggested by Matt Turner

Reviewed-by: Matt Turner <mattst88 at gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

---

 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index ea1e3e7..0f04f65 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -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);
 




More information about the mesa-commit mailing list