mesa: Remove ClearIndex and IndexMask from device-driver interface

These are used to inform the driver of the clear value for color-index
buffers and to control write-masking of bits in color-index buffers.
No driver use or need (not even Nouveau) these interfaces.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Ian Romanick
2010-02-24 19:12:30 -08:00
parent 5034e8ad42
commit bb8c3b1bcc
11 changed files with 0 additions and 77 deletions

View File

@@ -142,7 +142,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->BlendFuncSeparate = NULL; driver->BlendFuncSeparate = NULL;
driver->ClearColor = NULL; driver->ClearColor = NULL;
driver->ClearDepth = NULL; driver->ClearDepth = NULL;
driver->ClearIndex = NULL;
driver->ClearStencil = NULL; driver->ClearStencil = NULL;
driver->ClipPlane = NULL; driver->ClipPlane = NULL;
driver->ColorMask = NULL; driver->ColorMask = NULL;
@@ -157,7 +156,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->Enable = NULL; driver->Enable = NULL;
driver->Fogfv = NULL; driver->Fogfv = NULL;
driver->Hint = NULL; driver->Hint = NULL;
driver->IndexMask = NULL;
driver->Lightfv = NULL; driver->Lightfv = NULL;
driver->LightModelfv = NULL; driver->LightModelfv = NULL;
driver->LineStipple = NULL; driver->LineStipple = NULL;

View File

@@ -1156,12 +1156,10 @@ void mach64DDInitStateFuncs( GLcontext *ctx )
{ {
ctx->Driver.UpdateState = mach64DDInvalidateState; ctx->Driver.UpdateState = mach64DDInvalidateState;
ctx->Driver.ClearIndex = NULL;
ctx->Driver.ClearColor = mach64DDClearColor; ctx->Driver.ClearColor = mach64DDClearColor;
ctx->Driver.DrawBuffer = mach64DDDrawBuffer; ctx->Driver.DrawBuffer = mach64DDDrawBuffer;
ctx->Driver.ReadBuffer = mach64DDReadBuffer; ctx->Driver.ReadBuffer = mach64DDReadBuffer;
ctx->Driver.IndexMask = NULL;
ctx->Driver.ColorMask = mach64DDColorMask; ctx->Driver.ColorMask = mach64DDColorMask;
ctx->Driver.AlphaFunc = mach64DDAlphaFunc; ctx->Driver.AlphaFunc = mach64DDAlphaFunc;
ctx->Driver.BlendEquationSeparate = mach64DDBlendEquationSeparate; ctx->Driver.BlendEquationSeparate = mach64DDBlendEquationSeparate;

View File

@@ -1193,8 +1193,5 @@ void mgaDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.Viewport = mgaViewport; ctx->Driver.Viewport = mgaViewport;
ctx->Driver.RenderMode = mgaRenderMode; ctx->Driver.RenderMode = mgaRenderMode;
ctx->Driver.ClearIndex = 0;
ctx->Driver.IndexMask = 0;
TNL_CONTEXT(ctx)->Driver.RunPipeline = mgaRunPipeline; TNL_CONTEXT(ctx)->Driver.RunPipeline = mgaRunPipeline;
} }

View File

@@ -242,12 +242,6 @@ nouveau_fog(GLcontext *ctx, GLenum pname, const GLfloat *params)
context_dirty(ctx, FOG); context_dirty(ctx, FOG);
} }
static void
nouveau_index_mask(GLcontext *ctx, GLuint mask)
{
context_dirty(ctx, INDEX_MASK);
}
static void static void
nouveau_light(GLcontext *ctx, GLenum light, GLenum pname, const GLfloat *params) nouveau_light(GLcontext *ctx, GLenum light, GLenum pname, const GLfloat *params)
{ {
@@ -504,7 +498,6 @@ nouveau_state_init(GLcontext *ctx)
ctx->Driver.DrawBuffers = nouveau_draw_buffers; ctx->Driver.DrawBuffers = nouveau_draw_buffers;
ctx->Driver.Enable = nouveau_enable; ctx->Driver.Enable = nouveau_enable;
ctx->Driver.Fogfv = nouveau_fog; ctx->Driver.Fogfv = nouveau_fog;
ctx->Driver.IndexMask = nouveau_index_mask;
ctx->Driver.Lightfv = nouveau_light; ctx->Driver.Lightfv = nouveau_light;
ctx->Driver.LightModelfv = nouveau_light_model; ctx->Driver.LightModelfv = nouveau_light_model;
ctx->Driver.LineStipple = nouveau_line_stipple; ctx->Driver.LineStipple = nouveau_line_stipple;

View File

@@ -1407,13 +1407,11 @@ void r128DDInitStateFuncs( GLcontext *ctx )
{ {
ctx->Driver.UpdateState = r128DDInvalidateState; ctx->Driver.UpdateState = r128DDInvalidateState;
ctx->Driver.ClearIndex = NULL;
ctx->Driver.ClearColor = r128DDClearColor; ctx->Driver.ClearColor = r128DDClearColor;
ctx->Driver.ClearStencil = r128DDClearStencil; ctx->Driver.ClearStencil = r128DDClearStencil;
ctx->Driver.DrawBuffer = r128DDDrawBuffer; ctx->Driver.DrawBuffer = r128DDDrawBuffer;
ctx->Driver.ReadBuffer = r128DDReadBuffer; ctx->Driver.ReadBuffer = r128DDReadBuffer;
ctx->Driver.IndexMask = NULL;
ctx->Driver.ColorMask = r128DDColorMask; ctx->Driver.ColorMask = r128DDColorMask;
ctx->Driver.AlphaFunc = r128DDAlphaFunc; ctx->Driver.AlphaFunc = r128DDAlphaFunc;
ctx->Driver.BlendEquationSeparate = r128DDBlendEquationSeparate; ctx->Driver.BlendEquationSeparate = r128DDBlendEquationSeparate;

View File

@@ -2501,7 +2501,6 @@ void r200InitStateFuncs( struct dd_function_table *functions )
functions->BlendFuncSeparate = r200BlendFuncSeparate; functions->BlendFuncSeparate = r200BlendFuncSeparate;
functions->ClearColor = r200ClearColor; functions->ClearColor = r200ClearColor;
functions->ClearDepth = r200ClearDepth; functions->ClearDepth = r200ClearDepth;
functions->ClearIndex = NULL;
functions->ClearStencil = r200ClearStencil; functions->ClearStencil = r200ClearStencil;
functions->ClipPlane = r200ClipPlane; functions->ClipPlane = r200ClipPlane;
functions->ColorMask = r200ColorMask; functions->ColorMask = r200ColorMask;
@@ -2513,7 +2512,6 @@ void r200InitStateFuncs( struct dd_function_table *functions )
functions->Fogfv = r200Fogfv; functions->Fogfv = r200Fogfv;
functions->FrontFace = r200FrontFace; functions->FrontFace = r200FrontFace;
functions->Hint = NULL; functions->Hint = NULL;
functions->IndexMask = NULL;
functions->LightModelfv = r200LightModelfv; functions->LightModelfv = r200LightModelfv;
functions->Lightfv = r200Lightfv; functions->Lightfv = r200Lightfv;
functions->LineStipple = r200LineStipple; functions->LineStipple = r200LineStipple;

View File

@@ -2254,7 +2254,6 @@ void radeonInitStateFuncs( GLcontext *ctx , GLboolean dri2 )
ctx->Driver.BlendFuncSeparate = radeonBlendFuncSeparate; ctx->Driver.BlendFuncSeparate = radeonBlendFuncSeparate;
ctx->Driver.ClearColor = radeonClearColor; ctx->Driver.ClearColor = radeonClearColor;
ctx->Driver.ClearDepth = radeonClearDepth; ctx->Driver.ClearDepth = radeonClearDepth;
ctx->Driver.ClearIndex = NULL;
ctx->Driver.ClearStencil = radeonClearStencil; ctx->Driver.ClearStencil = radeonClearStencil;
ctx->Driver.ClipPlane = radeonClipPlane; ctx->Driver.ClipPlane = radeonClipPlane;
ctx->Driver.ColorMask = radeonColorMask; ctx->Driver.ColorMask = radeonColorMask;
@@ -2266,7 +2265,6 @@ void radeonInitStateFuncs( GLcontext *ctx , GLboolean dri2 )
ctx->Driver.Fogfv = radeonFogfv; ctx->Driver.Fogfv = radeonFogfv;
ctx->Driver.FrontFace = radeonFrontFace; ctx->Driver.FrontFace = radeonFrontFace;
ctx->Driver.Hint = NULL; ctx->Driver.Hint = NULL;
ctx->Driver.IndexMask = NULL;
ctx->Driver.LightModelfv = radeonLightModelfv; ctx->Driver.LightModelfv = radeonLightModelfv;
ctx->Driver.Lightfv = radeonLightfv; ctx->Driver.Lightfv = radeonLightfv;
ctx->Driver.LineStipple = radeonLineStipple; ctx->Driver.LineStipple = radeonLineStipple;

View File

@@ -629,21 +629,6 @@ static void flush(GLcontext* ctx)
} }
//---------------------------------------------------------------------------
/*
* Set the color index used to clear the color buffer.
*/
static void clear_index(GLcontext* ctx, GLuint index)
{
GLD_context *gldCtx = GLD_GET_CONTEXT(ctx);
WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx);
Current->clearpixel = index;
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
/* /*
@@ -1367,7 +1352,6 @@ static void wmesa_update_state_first_time(
ctx->Driver.Clear = clear; ctx->Driver.Clear = clear;
ctx->Driver.Flush = flush; ctx->Driver.Flush = flush;
ctx->Driver.ClearIndex = clear_index;
ctx->Driver.ClearColor = clear_color; ctx->Driver.ClearColor = clear_color;
ctx->Driver.Enable = enable; ctx->Driver.Enable = enable;

View File

@@ -106,18 +106,6 @@ finish_or_flush( GLcontext *ctx )
} }
static void
clear_index( GLcontext *ctx, GLuint index )
{
if (ctx->DrawBuffer->Name == 0) {
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
xmesa->clearpixel = (unsigned long) index;
XMesaSetForeground( xmesa->display, xmbuf->cleargc, (unsigned long) index );
}
}
static void static void
clear_color( GLcontext *ctx, const GLfloat color[4] ) clear_color( GLcontext *ctx, const GLfloat color[4] )
{ {
@@ -144,26 +132,6 @@ clear_color( GLcontext *ctx, const GLfloat color[4] )
/* Set index mask ala glIndexMask */
static void
index_mask( GLcontext *ctx, GLuint mask )
{
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
/* not sure this conditional is really needed */
if (xmbuf->backxrb && xmbuf->backxrb->pixmap) {
unsigned long m;
if (mask==0xffffffff) {
m = ((unsigned long)~0L);
}
else {
m = (unsigned long) mask;
}
XMesaSetPlaneMask( xmesa->display, xmbuf->cleargc, m );
}
}
/* Implements glColorMask() */ /* Implements glColorMask() */
static void static void
color_mask(GLcontext *ctx, color_mask(GLcontext *ctx,
@@ -1143,9 +1111,7 @@ xmesa_init_driver_functions( XMesaVisual xmvisual,
driver->GetBufferSize = NULL; /* OBSOLETE */ driver->GetBufferSize = NULL; /* OBSOLETE */
driver->Flush = finish_or_flush; driver->Flush = finish_or_flush;
driver->Finish = finish_or_flush; driver->Finish = finish_or_flush;
driver->ClearIndex = clear_index;
driver->ClearColor = clear_color; driver->ClearColor = clear_color;
driver->IndexMask = index_mask;
driver->ColorMask = color_mask; driver->ColorMask = color_mask;
driver->Enable = enable; driver->Enable = enable;
driver->Viewport = xmesa_viewport; driver->Viewport = xmesa_viewport;

View File

@@ -456,9 +456,6 @@ _mesa_IndexMask( GLuint mask )
FLUSH_VERTICES(ctx, _NEW_COLOR); FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.IndexMask = mask; ctx->Color.IndexMask = mask;
if (ctx->Driver.IndexMask)
ctx->Driver.IndexMask( ctx, mask );
} }
#endif #endif

View File

@@ -620,8 +620,6 @@ struct dd_function_table {
void (*ClearColor)(GLcontext *ctx, const GLfloat color[4]); void (*ClearColor)(GLcontext *ctx, const GLfloat color[4]);
/** Specify the clear value for the depth buffer */ /** Specify the clear value for the depth buffer */
void (*ClearDepth)(GLcontext *ctx, GLclampd d); void (*ClearDepth)(GLcontext *ctx, GLclampd d);
/** Specify the clear value for the color index buffers */
void (*ClearIndex)(GLcontext *ctx, GLuint index);
/** Specify the clear value for the stencil buffer */ /** Specify the clear value for the stencil buffer */
void (*ClearStencil)(GLcontext *ctx, GLint s); void (*ClearStencil)(GLcontext *ctx, GLint s);
/** Specify a plane against which all geometry is clipped */ /** Specify a plane against which all geometry is clipped */
@@ -653,8 +651,6 @@ struct dd_function_table {
void (*Fogfv)(GLcontext *ctx, GLenum pname, const GLfloat *params); void (*Fogfv)(GLcontext *ctx, GLenum pname, const GLfloat *params);
/** Specify implementation-specific hints */ /** Specify implementation-specific hints */
void (*Hint)(GLcontext *ctx, GLenum target, GLenum mode); void (*Hint)(GLcontext *ctx, GLenum target, GLenum mode);
/** Control the writing of individual bits in the color index buffers */
void (*IndexMask)(GLcontext *ctx, GLuint mask);
/** Set light source parameters. /** Set light source parameters.
* Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already
* been transformed to eye-space. * been transformed to eye-space.