diff options
| author | Keith Whitwell <keith@tungstengraphics.com> | 1999-09-30 11:18:21 +0000 | 
|---|---|---|
| committer | Keith Whitwell <keith@tungstengraphics.com> | 1999-09-30 11:18:21 +0000 | 
| commit | 69cfdb2fcb6c6d5538aff6533b587a54fb2e74c3 (patch) | |
| tree | 45a8d29aa8aff368d4e4c3ca6442a0566c16d6a4 | |
| parent | 0b6ae412d32ca2756f659f11d0c919812097716f (diff) | |
more hooks for mga driver, including an immediate fastpath
| -rw-r--r-- | src/mesa/main/blend.c | 10 | ||||
| -rw-r--r-- | src/mesa/main/dd.h | 26 | ||||
| -rw-r--r-- | src/mesa/main/light.c | 9 | ||||
| -rw-r--r-- | src/mesa/main/texobj.c | 13 | 
4 files changed, 51 insertions, 7 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index deac05c489..6bf3581b8f 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -1,4 +1,4 @@ -/* $Id: blend.c,v 1.2 1999/08/19 15:48:01 brianp Exp $ */ +/* $Id: blend.c,v 1.3 1999/09/30 11:18:21 keithw Exp $ */  /*   * Mesa 3-D graphics library @@ -203,6 +203,11 @@ gl_BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB,     ctx->Color.BlendFunc = NULL;     ctx->NewState |= NEW_RASTER_OPS; + +   if (ctx->Driver.BlendFuncSeparate) { +      (*ctx->Driver.BlendFuncSeparate)( ctx, sfactorRGB, dfactorRGB, +					sfactorA, dfactorA ); +   }  } @@ -243,6 +248,9 @@ void gl_BlendEquation( GLcontext *ctx, GLenum mode )     ctx->Color.BlendFunc = NULL;     ctx->NewState |= NEW_RASTER_OPS; +    +   if (ctx->Driver.BlendEquation) +      ctx->Driver.BlendEquation( ctx, mode );  } diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index aae4d71473..64b031e4e1 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -1,4 +1,4 @@ -/* $Id: dd.h,v 1.2 1999/09/18 20:41:22 keithw Exp $ */ +/* $Id: dd.h,v 1.3 1999/09/30 11:18:21 keithw Exp $ */  /*   * Mesa 3-D graphics library @@ -563,6 +563,23 @@ struct dd_function_table {      */ +   GLboolean (*IsTextureResident)( GLcontext *ctx,  +				   struct gl_texture_object *t ); +   /* +    * Allows the driver to implement the AreTexturesResident tests without +    * knowing about Mesa's internal hash tables for textures. +    */ + +   void (*PrioritizeTexture)( GLcontext *ctx,  +			      struct gl_texture_object *t, +			      GLclampf priority ); +   /* +    * Notify driver of priority change for a texture. +    */ + + + +     /***      *** NEW in Mesa 3.x      ***/ @@ -616,7 +633,11 @@ struct dd_function_table {      * the driver's UpdateState() function must do.      */     void (*AlphaFunc)(GLcontext *ctx, GLenum func, GLclampf ref); +   void (*BlendEquation)(GLcontext *ctx, GLenum mode);     void (*BlendFunc)(GLcontext *ctx, GLenum sfactor, GLenum dfactor); +   void (*BlendFuncSeparate)( GLcontext *ctx, GLenum sfactorRGB,  +			      GLenum dfactorRGB, GLenum sfactorA, +			      GLenum dfactorA );     void (*ClearDepth)(GLcontext *ctx, GLclampd d);     void (*CullFace)(GLcontext *ctx, GLenum mode);     void (*FrontFace)(GLcontext *ctx, GLenum mode); @@ -626,6 +647,9 @@ struct dd_function_table {     void (*Enable)(GLcontext* ctx, GLenum cap, GLboolean state);     void (*Fogfv)(GLcontext *ctx, GLenum pname, const GLfloat *params);     void (*Hint)(GLcontext *ctx, GLenum target, GLenum mode); +   void (*Lightfv)(GLcontext *ctx, GLenum light, +		   GLenum pname, const GLfloat *params, GLint nparams ); +   void (*LightModelfv)(GLcontext *ctx, GLenum pname, const GLfloat *params);     void (*PolygonMode)(GLcontext *ctx, GLenum face, GLenum mode);     void (*Scissor)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h);     void (*ShadeModel)(GLcontext *ctx, GLenum mode); diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 893438d445..715084bee6 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1,4 +1,4 @@ -/* $Id: light.c,v 1.2 1999/09/18 20:41:23 keithw Exp $ */ +/* $Id: light.c,v 1.3 1999/09/30 11:18:22 keithw Exp $ */  /*   * Mesa 3-D graphics library @@ -168,6 +168,9 @@ void gl_Lightfv( GLcontext *ctx,           break;     } +   if (ctx->Driver.Lightfv) +      ctx->Driver.Lightfv( ctx, light, pname, params, nparams ); +     ctx->NewState |= NEW_LIGHTING;  } @@ -328,6 +331,10 @@ void gl_LightModelfv( GLcontext *ctx, GLenum pname, const GLfloat *params )           gl_error( ctx, GL_INVALID_ENUM, "glLightModel" );           break;     } + +   if (ctx->Driver.LightModelfv)  +      ctx->Driver.LightModelfv( ctx, pname, params ); +     ctx->NewState |= NEW_LIGHTING;  } diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 78691d24f2..d94618d340 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1,4 +1,4 @@ -/* $Id: texobj.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: texobj.c,v 1.2 1999/09/30 11:18:22 keithw Exp $ */  /*   * Mesa 3-D graphics library @@ -507,6 +507,9 @@ void gl_PrioritizeTextures( GLcontext *ctx,              HashLookup(ctx->Shared->TexObjects, texName[i]);           if (t) {              t->Priority = CLAMP( priorities[i], 0.0F, 1.0F ); + +	    if (ctx->Driver.PrioritizeTexture) +	       ctx->Driver.PrioritizeTexture( ctx, t, t->Priority );           }        }     } @@ -515,7 +518,7 @@ void gl_PrioritizeTextures( GLcontext *ctx,  /* - * Execute glAreTexturesResident + * Execute glAreTexturesResident    */  GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n,                                    const GLuint *texName, @@ -541,8 +544,10 @@ GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n,        t = (struct gl_texture_object *)           HashLookup(ctx->Shared->TexObjects, texName[i]);        if (t) { -         /* we consider all valid texture objects to be resident */ -         residences[i] = GL_TRUE; +	 if (ctx->Driver.IsTextureResident) +	    residences[i] = ctx->Driver.IsTextureResident( ctx, t ); +	 else  +	    residences[i] = GL_TRUE;        }        else {           gl_error( ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)" );  | 
