From f21dfa9d4b7b1f4956a5c0e5926559d00bc19315 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 11 Mar 2012 18:31:32 -0600 Subject: [PATCH] mesa: remove ctx->Driver.ClearColor() hook The driver Clear() function should just grab the clear color out of the context. Reviewed-by: Dave Airlie --- src/mesa/drivers/common/driverfuncs.c | 1 - src/mesa/main/clear.c | 30 --------------------------- src/mesa/main/dd.h | 3 --- 3 files changed, 34 deletions(-) diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index c0e02970a82..ca120578da9 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -131,7 +131,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->BlendColor = NULL; driver->BlendEquationSeparate = NULL; driver->BlendFuncSeparate = NULL; - driver->ClearColor = NULL; driver->ClipPlane = NULL; driver->ColorMask = NULL; driver->ColorMaterial = NULL; diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c index de0a2bb1e2b..7cc204bc58d 100644 --- a/src/mesa/main/clear.c +++ b/src/mesa/main/clear.c @@ -88,14 +88,6 @@ _mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) FLUSH_VERTICES(ctx, _NEW_COLOR); COPY_4V(ctx->Color.ClearColor.f, tmp); - - if (ctx->Driver.ClearColor) { - /* it's OK to call glClearColor in CI mode but it should be a NOP */ - /* we pass the clamped color, since all drivers that need this don't - * support GL_ARB_color_buffer_float - */ - (*ctx->Driver.ClearColor)(ctx, ctx->Color.ClearColor); - } } @@ -119,11 +111,6 @@ _mesa_ClearColorIiEXT(GLint r, GLint g, GLint b, GLint a) FLUSH_VERTICES(ctx, _NEW_COLOR); COPY_4V(ctx->Color.ClearColor.i, tmp); - - /* these should be NOP calls for drivers supporting EXT_texture_integer */ - if (ctx->Driver.ClearColor) { - ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor); - } } @@ -147,11 +134,6 @@ _mesa_ClearColorIuiEXT(GLuint r, GLuint g, GLuint b, GLuint a) FLUSH_VERTICES(ctx, _NEW_COLOR); COPY_4V(ctx->Color.ClearColor.ui, tmp); - - /* these should be NOP calls for drivers supporting EXT_texture_integer */ - if (ctx->Driver.ClearColor) { - ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor); - } } @@ -365,14 +347,10 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value) clearSave = ctx->Color.ClearColor; /* set color */ COPY_4V(ctx->Color.ClearColor.i, value); - if (ctx->Driver.ClearColor) - ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor); /* clear buffer(s) */ ctx->Driver.Clear(ctx, mask); /* restore color */ ctx->Color.ClearColor = clearSave; - if (ctx->Driver.ClearColor) - ctx->Driver.ClearColor(ctx, clearSave); } } break; @@ -435,14 +413,10 @@ _mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value) clearSave = ctx->Color.ClearColor; /* set color */ COPY_4V(ctx->Color.ClearColor.ui, value); - if (ctx->Driver.ClearColor) - ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor); /* clear buffer(s) */ ctx->Driver.Clear(ctx, mask); /* restore color */ ctx->Color.ClearColor = clearSave; - if (ctx->Driver.ClearColor) - ctx->Driver.ClearColor(ctx, clearSave); } } break; @@ -537,14 +511,10 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value) clearSave = ctx->Color.ClearColor; /* set color */ COPY_4V_CAST(ctx->Color.ClearColor.f, value, GLclampf); - if (ctx->Driver.ClearColor) - ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor); /* clear buffer(s) */ ctx->Driver.Clear(ctx, mask); /* restore color */ ctx->Color.ClearColor = clearSave; - if (ctx->Driver.ClearColor) - ctx->Driver.ClearColor(ctx, clearSave); } } break; diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 7abf33ddda0..582eb5d492b 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -557,9 +557,6 @@ struct dd_function_table { void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA); - /** Specify clear values for the color buffers */ - void (*ClearColor)(struct gl_context *ctx, - const union gl_color_union color); /** Specify a plane against which all geometry is clipped */ void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *equation ); /** Enable and disable writing of frame buffer color components */ -- 2.30.2