diff options
author | Jason Ekstrand <[email protected]> | 2015-04-15 17:39:25 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-04-22 16:00:33 -0700 |
commit | 73bf8f3d6b6b571175c5ce324b44fef26915875f (patch) | |
tree | c810f27f01ca531381c6428e98681a493bd147cb /src/mesa/drivers | |
parent | 2bf207b47347ec1c672448e3019029f899a5d3b5 (diff) |
i965: Remove remaining uses of ctx->Const.UniformBooleanTrue in visitors
Since commit 2881b123, we have used 0/~0 for representing booleans on all
gens. However, we still had a bunch of places in the visitor code where we
were still referring to ctx->Const.UniformBooleanTrue. Since this is
always ~0, we can just remove them.
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-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"); |