From 3538f81513389b75cbd9e9b04a3723ce9c15b497 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 20 Apr 2006 02:16:55 +0000 Subject: Make most of the _mesa_noop_*() functions static. Generate GL_INVALID_VALUE, not GL_INVALID_ENUM when glVertexAttrib is called with a bad index. Use _mesa_noop_vtxfmt_init() in DRI drivers to initialize vertex format struct. --- src/mesa/drivers/dri/r200/r200_vtxfmt.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/mesa/drivers/dri/r200') diff --git a/src/mesa/drivers/dri/r200/r200_vtxfmt.c b/src/mesa/drivers/dri/r200/r200_vtxfmt.c index f42a046c00..673076d060 100644 --- a/src/mesa/drivers/dri/r200/r200_vtxfmt.c +++ b/src/mesa/drivers/dri/r200/r200_vtxfmt.c @@ -1056,12 +1056,16 @@ static void r200VtxFmtFlushVertices( GLcontext *ctx, GLuint flags ) */ +/** + * Called once during context creation. + */ void r200VtxfmtInit( GLcontext *ctx, GLboolean useCodegen ) { r200ContextPtr rmesa = R200_CONTEXT( ctx ); GLvertexformat *vfmt = &(rmesa->vb.vtxfmt); - MEMSET( vfmt, 0, sizeof(GLvertexformat) ); + /* start by initializing to no-op functions */ + _mesa_noop_vtxfmt_init(vfmt); /* Hook in chooser functions for codegen, etc: */ @@ -1071,7 +1075,6 @@ void r200VtxfmtInit( GLcontext *ctx, GLboolean useCodegen ) */ vfmt->Materialfv = r200_Materialfv; vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ - vfmt->Rectf = _mesa_noop_Rectf; /* generic helper */ vfmt->Begin = r200_Begin; vfmt->End = r200_End; @@ -1085,15 +1088,6 @@ void r200VtxfmtInit( GLcontext *ctx, GLboolean useCodegen ) vfmt->DrawElements = r200_fallback_DrawElements; vfmt->DrawRangeElements = r200_fallback_DrawRangeElements; - - /* Not active in supported states; just keep ctx->Current uptodate: - */ - vfmt->EdgeFlag = _mesa_noop_EdgeFlag; - vfmt->EdgeFlagv = _mesa_noop_EdgeFlagv; - vfmt->Indexf = _mesa_noop_Indexf; - vfmt->Indexfv = _mesa_noop_Indexfv; - - /* Active but unsupported -- fallback if we receive these: */ vfmt->CallList = r200_fallback_CallList; -- cgit v1.2.3