[Mesa-dev] [PATCH 3/7] mesa: remove ctx->Driver.ClearDepth(), ClearStencil() driver hooks
Brian Paul
brianp at vmware.com
Sun Mar 11 17:33:53 PDT 2012
Not used by any drivers. Drivers can easily access the values
from the Mesa context at glClear() time.
---
src/mesa/drivers/common/driverfuncs.c | 2 --
src/mesa/main/clear.c | 16 ----------------
src/mesa/main/dd.h | 4 ----
src/mesa/main/depth.c | 2 --
src/mesa/main/stencil.c | 4 ----
5 files changed, 0 insertions(+), 28 deletions(-)
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index 1df8381..c0e0297 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -132,8 +132,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->BlendEquationSeparate = NULL;
driver->BlendFuncSeparate = NULL;
driver->ClearColor = NULL;
- driver->ClearDepth = NULL;
- driver->ClearStencil = 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 e4df120..de0a2bb 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -346,12 +346,8 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
*/
const GLuint clearSave = ctx->Stencil.Clear;
ctx->Stencil.Clear = *value;
- if (ctx->Driver.ClearStencil)
- ctx->Driver.ClearStencil(ctx, *value);
ctx->Driver.Clear(ctx, BUFFER_BIT_STENCIL);
ctx->Stencil.Clear = clearSave;
- if (ctx->Driver.ClearStencil)
- ctx->Driver.ClearStencil(ctx, clearSave);
}
break;
case GL_COLOR:
@@ -521,12 +517,8 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
*/
const GLclampd clearSave = ctx->Depth.Clear;
ctx->Depth.Clear = *value;
- if (ctx->Driver.ClearDepth)
- ctx->Driver.ClearDepth(ctx, *value);
ctx->Driver.Clear(ctx, BUFFER_BIT_DEPTH);
ctx->Depth.Clear = clearSave;
- if (ctx->Driver.ClearDepth)
- ctx->Driver.ClearDepth(ctx, clearSave);
}
/* clear depth buffer to value */
break;
@@ -637,10 +629,6 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
/* set new clear values */
ctx->Depth.Clear = depth;
ctx->Stencil.Clear = stencil;
- if (ctx->Driver.ClearDepth)
- ctx->Driver.ClearDepth(ctx, depth);
- if (ctx->Driver.ClearStencil)
- ctx->Driver.ClearStencil(ctx, stencil);
/* clear buffers */
ctx->Driver.Clear(ctx, mask);
@@ -648,9 +636,5 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
/* restore */
ctx->Depth.Clear = clearDepthSave;
ctx->Stencil.Clear = clearStencilSave;
- if (ctx->Driver.ClearDepth)
- ctx->Driver.ClearDepth(ctx, clearDepthSave);
- if (ctx->Driver.ClearStencil)
- ctx->Driver.ClearStencil(ctx, clearStencilSave);
}
}
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 9631113..7abf33d 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -560,10 +560,6 @@ struct dd_function_table {
/** Specify clear values for the color buffers */
void (*ClearColor)(struct gl_context *ctx,
const union gl_color_union color);
- /** Specify the clear value for the depth buffer */
- void (*ClearDepth)(struct gl_context *ctx, GLclampd d);
- /** Specify the clear value for the stencil buffer */
- void (*ClearStencil)(struct gl_context *ctx, GLint s);
/** 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 */
diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c
index 52c69a6..bb16254 100644
--- a/src/mesa/main/depth.c
+++ b/src/mesa/main/depth.c
@@ -54,8 +54,6 @@ _mesa_ClearDepth( GLclampd depth )
FLUSH_VERTICES(ctx, _NEW_DEPTH);
ctx->Depth.Clear = depth;
- if (ctx->Driver.ClearDepth)
- (*ctx->Driver.ClearDepth)( ctx, ctx->Depth.Clear );
}
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index b6993ff..f47b57b 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -115,10 +115,6 @@ _mesa_ClearStencil( GLint s )
FLUSH_VERTICES(ctx, _NEW_STENCIL);
ctx->Stencil.Clear = (GLuint) s;
-
- if (ctx->Driver.ClearStencil) {
- ctx->Driver.ClearStencil( ctx, s );
- }
}
--
1.7.3.4
More information about the mesa-dev
mailing list