From 9d4f67600b0a8f4b37eb2ed45b194e153669d11a Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 28 Mar 2013 02:48:17 +0100 Subject: mesa: move updating clamp control derived state out of mesa_update_state_locked It has 2 dependencies: glClampColor and the framebuffer, we might just as well do the update where those two are changed. v2: cosmetic changes from Brian's email Reviewed-by: Brian Paul --- src/mesa/main/state.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'src/mesa/main/state.c') diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 73c5a1c263f..251c1aea934 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -308,36 +308,6 @@ update_multisample(struct gl_context *ctx) } -/** - * Update the ctx->Color._ClampFragmentColor field - */ -static void -update_clamp_fragment_color(struct gl_context *ctx) -{ - struct gl_framebuffer *fb = ctx->DrawBuffer; - - /* Don't clamp if: - * - there is no colorbuffer - * - all colorbuffers are unsigned normalized, so clamping has no effect - * - there is an integer colorbuffer - */ - if (!fb || !fb->_HasSNormOrFloatColorBuffer || fb->_IntegerColor) - ctx->Color._ClampFragmentColor = GL_FALSE; - else - ctx->Color._ClampFragmentColor = _mesa_get_clamp_fragment_color(ctx); -} - - -/** - * Update the ctx->Color._ClampVertexColor field - */ -static void -update_clamp_vertex_color(struct gl_context *ctx) -{ - ctx->Light._ClampVertexColor = _mesa_get_clamp_vertex_color(ctx); -} - - /** * Update the ctx->VertexProgram._TwoSideEnabled flag. */ @@ -497,9 +467,6 @@ _mesa_update_state_locked( struct gl_context *ctx ) if (new_state & (_NEW_LIGHT | _NEW_PROGRAM)) update_twoside( ctx ); - if (new_state & (_NEW_LIGHT | _NEW_BUFFERS)) - update_clamp_vertex_color(ctx); - if (new_state & (_NEW_STENCIL | _NEW_BUFFERS)) _mesa_update_stencil( ctx ); @@ -515,9 +482,6 @@ _mesa_update_state_locked( struct gl_context *ctx ) if (new_state & (_NEW_MULTISAMPLE | _NEW_BUFFERS)) update_multisample( ctx ); - if(new_state & (_NEW_FRAG_CLAMP | _NEW_BUFFERS)) - update_clamp_fragment_color(ctx); - #if 0 if (new_state & (_NEW_POINT | _NEW_LINE | _NEW_POLYGON | _NEW_LIGHT | _NEW_STENCIL | _MESA_NEW_SEPARATE_SPECULAR)) -- cgit v1.2.3