From 2836aab2031d5b6926923fbc70f867ec638301bd Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 9 Sep 2011 14:23:15 -0700 Subject: [PATCH] mesa: Use ColorLogicOpEnabled instead of _LogicOpEnabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since GL_EXT_blend_logic_op is removed, _LogicOpEnabled and ColorLogicOpEnabled always have the same value. Signed-off-by: Ian Romanick Reviewed-by: Roland Scheidegger Reviewed-by: Eric Anholt Reviewed-by: Marek Olšák --- src/mesa/drivers/dri/i965/brw_cc.c | 2 +- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 2 +- src/mesa/drivers/dri/i965/gen6_cc.c | 2 +- src/mesa/drivers/dri/radeon/radeon_pixel_read.c | 2 +- src/mesa/main/blend.c | 1 - src/mesa/main/mtypes.h | 1 - src/mesa/main/state.c | 16 ---------------- src/mesa/swrast/s_blend.c | 2 +- src/mesa/swrast/s_context.c | 2 +- src/mesa/swrast/s_span.c | 2 +- 10 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index 9c26150d241..c8ef8dbabae 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -143,7 +143,7 @@ static void upload_cc_unit(struct brw_context *brw) } /* _NEW_COLOR */ - if (ctx->Color._LogicOpEnabled && ctx->Color.LogicOp != GL_COPY) { + if (ctx->Color.ColorLogicOpEnabled && ctx->Color.LogicOp != GL_COPY) { cc->cc2.logicop_enable = 1; cc->cc5.logicop_func = intel_translate_logic_op(ctx->Color.LogicOp); } else if (ctx->Color.BlendEnabled) { diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 7528952f71d..1df2202b939 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -507,7 +507,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, if (intel->gen < 6) { /* _NEW_COLOR */ - if (!ctx->Color._LogicOpEnabled && + if (!ctx->Color.ColorLogicOpEnabled && (ctx->Color.BlendEnabled & (1 << unit))) surf[0] |= BRW_SURFACE_BLEND_ENABLED; diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c index 41d13ad2bf4..b8047d5e9f0 100644 --- a/src/mesa/drivers/dri/i965/gen6_cc.c +++ b/src/mesa/drivers/dri/i965/gen6_cc.c @@ -58,7 +58,7 @@ prepare_blend_state(struct brw_context *brw) for (b = 0; b < nr_draw_buffers; b++) { /* _NEW_COLOR */ - if (ctx->Color._LogicOpEnabled) { + if (ctx->Color.ColorLogicOpEnabled) { struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[b]; /* _NEW_BUFFERS */ /* Floating point RTs should have no effect from LogicOp, diff --git a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c index e44d6f2f8f7..62e047157d7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c +++ b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c @@ -109,7 +109,7 @@ do_blit_readpixels(struct gl_context * ctx, return GL_FALSE; } - if (ctx->_ImageTransferState || ctx->Color._LogicOpEnabled) { + if (ctx->_ImageTransferState || ctx->Color.ColorLogicOpEnabled) { return GL_FALSE; } diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 4dcc0b9d2a3..98c14f56171 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -807,7 +807,6 @@ void _mesa_init_color( struct gl_context * ctx ) ASSIGN_4V( ctx->Color.BlendColorUnclamped, 0.0, 0.0, 0.0, 0.0 ); ctx->Color.IndexLogicOpEnabled = GL_FALSE; ctx->Color.ColorLogicOpEnabled = GL_FALSE; - ctx->Color._LogicOpEnabled = GL_FALSE; ctx->Color.LogicOp = GL_COPY; ctx->Color.DitherFlag = GL_TRUE; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d25d1a021a9..3b44ec6d58f 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -789,7 +789,6 @@ struct gl_colorbuffer_attrib GLenum LogicOp; /**< Logic operator */ GLboolean IndexLogicOpEnabled; /**< Color index logic op enabled flag */ GLboolean ColorLogicOpEnabled; /**< RGBA logic op enabled flag */ - GLboolean _LogicOpEnabled; /**< RGBA logic op + EXT_blend_logic_op enabled flag */ /*@}*/ GLboolean DitherFlag; /**< Dither enable flag */ diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 457a730deea..9d9c952dcef 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -406,19 +406,6 @@ update_multisample(struct gl_context *ctx) } -/** - * Update derived color/blend/logicop state. - */ -static void -update_color(struct gl_context *ctx) -{ - /* This is needed to support 1.1's RGB logic ops AND - * 1.0's blending logicops. - */ - ctx->Color._LogicOpEnabled = _mesa_rgba_logicop_enabled(ctx); -} - - /** * Update the ctx->Color._ClampFragmentColor field */ @@ -634,9 +621,6 @@ _mesa_update_state_locked( struct gl_context *ctx ) if (new_state & (_NEW_MULTISAMPLE | _NEW_BUFFERS)) update_multisample( ctx ); - if (new_state & _NEW_COLOR) - update_color( ctx ); - if (new_state & (_NEW_COLOR | _NEW_BUFFERS)) update_clamp_read_color(ctx); diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index 3760f91d64b..be5010b1383 100644 --- a/src/mesa/swrast/s_blend.c +++ b/src/mesa/swrast/s_blend.c @@ -1001,7 +1001,7 @@ _swrast_blend_span(struct gl_context *ctx, struct gl_renderbuffer *rb, SWspan *s ASSERT(span->end <= MAX_WIDTH); ASSERT(span->arrayMask & SPAN_RGBA); ASSERT(rb->DataType == span->array->ChanType); - ASSERT(!ctx->Color._LogicOpEnabled); + ASSERT(!ctx->Color.ColorLogicOpEnabled); rbPixels = _swrast_get_dest_rgba(ctx, rb, span); diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 7651eaf22ee..0c33dff1254 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -72,7 +72,7 @@ _swrast_update_rasterflags( struct gl_context *ctx ) break; } } - if (ctx->Color._LogicOpEnabled) rasterMask |= LOGIC_OP_BIT; + if (ctx->Color.ColorLogicOpEnabled) rasterMask |= LOGIC_OP_BIT; if (ctx->Texture._EnabledUnits) rasterMask |= TEXTURE_BIT; if ( ctx->Viewport.X < 0 || ctx->Viewport.X + ctx->Viewport.Width > (GLint) ctx->DrawBuffer->Width diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 9a91be39970..16ff7ff0282 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1248,7 +1248,7 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span) ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_ALPHA); - if (ctx->Color._LogicOpEnabled) { + if (ctx->Color.ColorLogicOpEnabled) { _swrast_logicop_rgba_span(ctx, rb, span); } else if ((ctx->Color.BlendEnabled >> buf) & 1) { -- 2.30.2