more hooks for mga driver, including an immediate fastpath

This commit is contained in:
Keith Whitwell
1999-09-30 11:18:21 +00:00
parent 0b6ae412d3
commit 69cfdb2fcb
4 changed files with 51 additions and 7 deletions

View File

@@ -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 );
}

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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)" );