aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-08-08 19:44:22 -0700
committerMatt Turner <[email protected]>2014-08-18 18:35:49 -0700
commit2a6b6621d83b83f4ce499cd0c5b8eb824f07d25d (patch)
tree8a7fe27b6908d2685c165625927d47db52f75473 /src/mesa
parent9e2e7c7dc0ff08a2066435dd519502340955bbd2 (diff)
i965: Use UniformBooleanTrue value for boolean literal true.
Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_visitor.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 05082eed719..1245c8a7667 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -2209,7 +2209,9 @@ fs_visitor::visit(ir_constant *ir)
emit(MOV(dst_reg, fs_reg(ir->value.i[i])));
break;
case GLSL_TYPE_BOOL:
- emit(MOV(dst_reg, fs_reg((int)ir->value.b[i])));
+ emit(MOV(dst_reg,
+ fs_reg(ir->value.b[i] != 0 ? ctx->Const.UniformBooleanTrue
+ : 0)));
break;
default:
unreachable("Non-float/uint/int/bool constant");
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index f22d38d71ee..cb9a1b1b68f 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2231,7 +2231,9 @@ vec4_visitor::emit_constant_values(dst_reg *dst, ir_constant *ir)
emit(MOV(*dst, src_reg(ir->value.u[i])));
break;
case GLSL_TYPE_BOOL:
- emit(MOV(*dst, src_reg(ir->value.b[i])));
+ emit(MOV(*dst,
+ src_reg(ir->value.b[i] != 0 ? ctx->Const.UniformBooleanTrue
+ : 0)));
break;
default:
unreachable("Non-float/uint/int/bool constant");