diff options
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 14 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 2b8dfe44766..4d1afb14074 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -2639,9 +2639,7 @@ 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(ir->value.b[i] != 0 ? (int)ctx->Const.UniformBooleanTrue - : 0))); + emit(MOV(dst_reg, fs_reg(ir->value.b[i] != 0 ? ~0 : 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 20e61099e61..c9a496e6c74 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -1635,7 +1635,7 @@ vec4_visitor::visit(ir_expression *ir) ir->operands[1]->type->is_vector()) { emit(CMP(dst_null_d(), op[0], op[1], BRW_CONDITIONAL_Z)); emit(MOV(result_dst, src_reg(0))); - inst = emit(MOV(result_dst, src_reg((int)ctx->Const.UniformBooleanTrue))); + inst = emit(MOV(result_dst, src_reg(~0))); inst->predicate = BRW_PREDICATE_ALIGN16_ALL4H; } else { emit(CMP(result_dst, op[0], op[1], BRW_CONDITIONAL_Z)); @@ -1653,7 +1653,7 @@ vec4_visitor::visit(ir_expression *ir) emit(CMP(dst_null_d(), op[0], op[1], BRW_CONDITIONAL_NZ)); emit(MOV(result_dst, src_reg(0))); - inst = emit(MOV(result_dst, src_reg((int)ctx->Const.UniformBooleanTrue))); + inst = emit(MOV(result_dst, src_reg(~0))); inst->predicate = BRW_PREDICATE_ALIGN16_ANY4H; } else { emit(CMP(result_dst, op[0], op[1], BRW_CONDITIONAL_NZ)); @@ -1667,7 +1667,7 @@ vec4_visitor::visit(ir_expression *ir) emit(CMP(dst_null_d(), op[0], src_reg(0), BRW_CONDITIONAL_NZ)); emit(MOV(result_dst, src_reg(0))); - inst = emit(MOV(result_dst, src_reg((int)ctx->Const.UniformBooleanTrue))); + inst = emit(MOV(result_dst, src_reg(~0))); inst->predicate = BRW_PREDICATE_ALIGN16_ANY4H; break; @@ -1862,9 +1862,7 @@ vec4_visitor::visit(ir_expression *ir) const_offset % 16 / 4, const_offset % 16 / 4); - /* UBO bools are any nonzero int. We need to convert them to use the - * value of true stored in ctx->Const.UniformBooleanTrue. - */ + /* UBO bools are any nonzero int. We need to convert them to 0/~0. */ if (ir->type->base_type == GLSL_TYPE_BOOL) { emit(CMP(result_dst, packed_consts, src_reg(0u), BRW_CONDITIONAL_NZ)); @@ -2370,9 +2368,7 @@ 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] != 0 ? (int)ctx->Const.UniformBooleanTrue - : 0))); + emit(MOV(*dst, src_reg(ir->value.b[i] != 0 ? ~0 : 0))); break; default: unreachable("Non-float/uint/int/bool constant"); |