From 2a6b6621d83b83f4ce499cd0c5b8eb824f07d25d Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Fri, 8 Aug 2014 19:44:22 -0700 Subject: [PATCH] i965: Use UniformBooleanTrue value for boolean literal true. Reviewed-by: Anuj Phogat --- src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 4 +++- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 4 +++- 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"); -- 2.30.2