From 2e1cc883b380c3e038b7f2890bf80ed1736a9f18 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 9 Sep 2011 14:27:38 -0700 Subject: [PATCH] mesa: Replace _mesa_rgba_logicop_enabled(ctx) with ctx->Color.ColorLogicOpEnabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since GL_EXT_blend_logic_op is removed, _mesa_rgba_logicop_enabled(ctx) just returns ctx->Color.ColorLogicOpEnabled. That seems kind of silly. Signed-off-by: Ian Romanick Reviewed-by: Roland Scheidegger Reviewed-by: Eric Anholt Reviewed-by: Marek Olšák --- src/mesa/drivers/dri/i915/i830_state.c | 2 +- src/mesa/drivers/dri/i915/i915_state.c | 2 +- src/mesa/drivers/dri/r300/r300_state.c | 6 +++--- src/mesa/drivers/dri/r600/evergreen_state.c | 6 +++--- src/mesa/drivers/dri/r600/r700_state.c | 6 +++--- src/mesa/main/state.h | 12 ------------ 6 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c index 9fecab10db9..8ca796f83c1 100644 --- a/src/mesa/drivers/dri/i915/i830_state.c +++ b/src/mesa/drivers/dri/i915/i830_state.c @@ -235,7 +235,7 @@ i830EvalLogicOpBlendState(struct gl_context * ctx) I830_STATECHANGE(i830, I830_UPLOAD_CTX); - if (_mesa_rgba_logicop_enabled(ctx)) { + if (ctx->Color.ColorLogicOpEnabled) { i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND | ENABLE_LOGIC_OP_MASK); i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND | diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index 2b35ed7105a..44d122e6a0a 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -210,7 +210,7 @@ i915EvalLogicOpBlendState(struct gl_context * ctx) dw0 = i915->state.Ctx[I915_CTXREG_LIS5]; dw1 = i915->state.Ctx[I915_CTXREG_LIS6]; - if (_mesa_rgba_logicop_enabled(ctx)) { + if (ctx->Color.ColorLogicOpEnabled) { dw0 |= S5_LOGICOP_ENABLE; dw1 &= ~S6_CBUF_BLEND_ENABLE; } diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 93a0dd168f4..51d794c9756 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -214,7 +214,7 @@ static void r300SetBlendState(struct gl_context * ctx) (R300_BLEND_GL_ZERO << R300_DST_BLEND_SHIFT); int eqnA = R300_COMB_FCN_ADD_CLAMP; - if (_mesa_rgba_logicop_enabled(ctx) || !ctx->Color.BlendEnabled) { + if (ctx->Color.ColorLogicOpEnabled || !ctx->Color.BlendEnabled) { r300SetBlendCntl(r300, func, eqn, 0, func, eqn); return; } @@ -335,7 +335,7 @@ static void r300SetLogicOpState(struct gl_context *ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); R300_STATECHANGE(r300, rop); - if (_mesa_rgba_logicop_enabled(ctx)) { + if (ctx->Color.ColorLogicOpEnabled) { r300->hw.rop.cmd[1] = R300_RB3D_ROPCNTL_ROP_ENABLE | translate_logicop(ctx->Color.LogicOp); } else { @@ -349,7 +349,7 @@ static void r300SetLogicOpState(struct gl_context *ctx) */ static void r300LogicOpcode(struct gl_context *ctx, GLenum logicop) { - if (_mesa_rgba_logicop_enabled(ctx)) + if (ctx->Color.ColorLogicOpEnabled) r300SetLogicOpState(ctx); } diff --git a/src/mesa/drivers/dri/r600/evergreen_state.c b/src/mesa/drivers/dri/r600/evergreen_state.c index 81bf1172dc3..a908af4e12f 100644 --- a/src/mesa/drivers/dri/r600/evergreen_state.c +++ b/src/mesa/drivers/dri/r600/evergreen_state.c @@ -343,7 +343,7 @@ static void evergreenSetBlendState(struct gl_context * ctx) //diff : CB_COLOR_CO EVERGREEN_STATECHANGE(context, cb); - if (_mesa_rgba_logicop_enabled(ctx) || !ctx->Color.BlendEnabled) { + if (ctx->Color.ColorLogicOpEnabled || !ctx->Color.BlendEnabled) { SETfield(blend_reg, BLEND_ONE, COLOR_SRCBLEND_shift, COLOR_SRCBLEND_mask); SETfield(blend_reg, @@ -521,7 +521,7 @@ static void evergreenSetLogicOpState(struct gl_context *ctx) //diff : CB_COLOR_C EVERGREEN_STATECHANGE(context, cb); - if (_mesa_rgba_logicop_enabled(ctx)) + if (ctx->Color.ColorLogicOpEnabled) SETfield(evergreen->CB_COLOR_CONTROL.u32All, evergreen_translate_logicop(ctx->Color.LogicOp), EG_CB_COLOR_CONTROL__ROP3_shift, @@ -1149,7 +1149,7 @@ static void evergreenShadeModel(struct gl_context * ctx, GLenum mode) //same static void evergreenLogicOpcode(struct gl_context *ctx, GLenum logicop) //diff { - if (_mesa_rgba_logicop_enabled(ctx)) + if (ctx->Color.ColorLogicOpEnabled) evergreenSetLogicOpState(ctx); } diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 4d285b36489..99c03dff83e 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -454,7 +454,7 @@ static void r700SetBlendState(struct gl_context * ctx) R600_STATECHANGE(context, blnd); - if (_mesa_rgba_logicop_enabled(ctx) || !ctx->Color.BlendEnabled) { + if (ctx->Color.ColorLogicOpEnabled || !ctx->Color.BlendEnabled) { SETfield(blend_reg, BLEND_ONE, COLOR_SRCBLEND_shift, COLOR_SRCBLEND_mask); SETfield(blend_reg, @@ -645,7 +645,7 @@ static void r700SetLogicOpState(struct gl_context *ctx) R600_STATECHANGE(context, blnd); - if (_mesa_rgba_logicop_enabled(ctx)) + if (ctx->Color.ColorLogicOpEnabled) SETfield(r700->CB_COLOR_CONTROL.u32All, translate_logicop(ctx->Color.LogicOp), ROP3_shift, ROP3_mask); else @@ -658,7 +658,7 @@ static void r700SetLogicOpState(struct gl_context *ctx) */ static void r700LogicOpcode(struct gl_context *ctx, GLenum logicop) { - if (_mesa_rgba_logicop_enabled(ctx)) + if (ctx->Color.ColorLogicOpEnabled) r700SetLogicOpState(ctx); } diff --git a/src/mesa/main/state.h b/src/mesa/main/state.h index 7ff1c5b59b3..7feeb9007ca 100644 --- a/src/mesa/main/state.h +++ b/src/mesa/main/state.h @@ -72,16 +72,4 @@ _mesa_need_secondary_color(const struct gl_context *ctx) return GL_FALSE; } - -/** - * Is RGBA LogicOp enabled? - */ -static INLINE GLboolean -_mesa_rgba_logicop_enabled(const struct gl_context *ctx) -{ - return ctx->Color.ColorLogicOpEnabled; -} - - - #endif -- 2.30.2