summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2014-08-03 01:27:32 -0400
committerIlia Mirkin <[email protected]>2014-08-03 10:05:53 -0400
commit7b3d0a9a1eb11bf70390ad116ed662a47f06183e (patch)
tree81108329cd41668e2331723a54da859842a3a2fe
parent152006e149501a803aed0e705eb9b4d2f400ab35 (diff)
mesa/st: only convert AND(a, NOT(b)) into MAD when not using native integers
Native integers imply a somewhat different handling of booleans. Instead of being 1.0/0.0 floats, they are 0 (true) / -1 (false) integers. As such the original optimization no longer applies. Reported-by: Glenn Kennard <[email protected]> Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: "10.2" <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 27e4615f997..b818139baf7 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1354,7 +1354,7 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
/* Quick peephole: Emit OPCODE_MAD(-a, -b, a) instead of AND(a, NOT(b))
*/
- if (ir->operation == ir_binop_logic_and) {
+ if (!native_integers && ir->operation == ir_binop_logic_and) {
if (try_emit_mad_for_and_not(ir, 1))
return;
if (try_emit_mad_for_and_not(ir, 0))