diff options
author | Keith Whitwell <[email protected]> | 2001-01-08 04:09:41 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2001-01-08 04:09:41 +0000 |
commit | b980b2eeb62dc48101a7481d02d196c80b9da397 (patch) | |
tree | 2b9bf4b63b99a6df4e96123181da0a624289ad92 /src/mesa/tnl | |
parent | 44d8de433e684cb4c2bc4dfc5cc6919af1f3cc55 (diff) |
Add a 'RenderPrimitive' callback to t_vb_render.c. Helps out drivers
that used to require a 'ReducedPrimitiveChange' callback.
Various compilation fixes for XFree86.
Reverted to the older version of glcore.h used internally in XFree86, and
moved it to 'Mesa/include/GL/internal/glcore.h', for compatibility with
XFree86.
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r-- | src/mesa/tnl/t_array_import.c | 10 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_light.c | 8 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_render.c | 3 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_rendertmp.h | 16 |
4 files changed, 24 insertions, 13 deletions
diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c index 008cc23c64e..087852febef 100644 --- a/src/mesa/tnl/t_array_import.c +++ b/src/mesa/tnl/t_array_import.c @@ -1,4 +1,4 @@ -/* $Id: t_array_import.c,v 1.4 2001/01/05 02:26:49 keithw Exp $ */ +/* $Id: t_array_import.c,v 1.5 2001/01/08 04:09:41 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -267,31 +267,37 @@ static void _tnl_upgrade_client_data( GLcontext *ctx, if ((required & VERT_OBJ) && (VB->ObjPtr->flags & flags)) { ASSERT(VB->ObjPtr == &inputs->Obj); _tnl_import_vertex( ctx, writeable, stride ); + VB->importable_data &= ~(VERT_OBJ|VERT_CLIP); } if ((required & VERT_NORM) && (VB->NormalPtr->flags & flags)) { ASSERT(VB->NormalPtr == &inputs->Normal); _tnl_import_normal( ctx, writeable, stride ); + VB->importable_data &= ~VERT_NORM; } if ((required & VERT_RGBA) && (VB->ColorPtr[0]->flags & flags)) { ASSERT(VB->ColorPtr[0] == &inputs->Color); _tnl_import_color( ctx, writeable, stride ); + VB->importable_data &= ~VERT_RGBA; } if ((required & VERT_SPEC_RGB) && (VB->SecondaryColorPtr[0]->flags&flags)) { ASSERT(VB->SecondaryColorPtr[0] == &inputs->SecondaryColor); _tnl_import_secondarycolor( ctx, writeable, stride ); + VB->importable_data &= ~VERT_SPEC_RGB; } if ((required & VERT_FOG_COORD) && (VB->FogCoordPtr->flags & flags)) { ASSERT(VB->FogCoordPtr == &inputs->FogCoord); _tnl_import_fogcoord( ctx, writeable, stride ); + VB->importable_data &= ~VERT_FOG_COORD; } if ((required & VERT_INDEX) && (VB->IndexPtr[0]->flags & flags)) { ASSERT(VB->IndexPtr[0] == &inputs->Index); _tnl_import_index( ctx, writeable, stride ); + VB->importable_data &= ~VERT_INDEX; } if (required & VERT_TEX_ANY) @@ -299,9 +305,9 @@ static void _tnl_upgrade_client_data( GLcontext *ctx, if ((required & VERT_TEX(i)) && (VB->TexCoordPtr[i]->flags & flags)) { ASSERT(VB->TexCoordPtr[i] == &inputs->TexCoord[i]); _tnl_import_texcoord( ctx, i, writeable, stride ); + VB->importable_data &= ~VERT_TEX(i); } - VB->importable_data &= ~required; } diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index 043eb7302fc..48c8e093137 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_light.c,v 1.2 2000/12/27 19:57:37 keithw Exp $ */ +/* $Id: t_vb_light.c,v 1.3 2001/01/08 04:09:42 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -246,6 +246,10 @@ static void check_lighting( GLcontext *ctx, struct gl_pipeline_stage *stage ) stage->inputs |= VERT_EYE; /* effectively, even when lighting in obj */ if (ctx->Light.ColorMaterialEnabled) stage->inputs |= VERT_RGBA; + + stage->outputs = VERT_RGBA; + if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) + stage->outputs |= VERT_SPEC_RGB; } } @@ -273,7 +277,7 @@ const struct gl_pipeline_stage _tnl_lighting_stage = _NEW_LIGHT|_NEW_MODELVIEW, /* recalc -- modelview dependency * otherwise not captured by inputs * (which may be VERT_OBJ) */ - 0,0,VERT_RGBA, /* active, inputs, outputs */ + 0,0,0, /* active, inputs, outputs */ 0,0, /* changed_inputs, private_data */ dtr, /* destroy */ check_lighting, /* check */ diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c index 2616d294d3b..7279dc17ba2 100644 --- a/src/mesa/tnl/t_vb_render.c +++ b/src/mesa/tnl/t_vb_render.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_render.c,v 1.6 2001/01/05 02:26:49 keithw Exp $ */ +/* $Id: t_vb_render.c,v 1.7 2001/01/08 04:09:42 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -487,6 +487,7 @@ do { \ (void) elt; (void) mask; (void) sz; #define TAG(x) clip_##x##_verts +#define INIT(x) ctx->Driver.RenderPrimitive( ctx, x ) #define RESET_STIPPLE ctx->Driver.ResetLineStipple( ctx ) #define RESET_OCCLUSION ctx->OcclusionResult = GL_TRUE; #define PRESERVE_VB_DEFS diff --git a/src/mesa/tnl/t_vb_rendertmp.h b/src/mesa/tnl/t_vb_rendertmp.h index 9c9271ff226..194dd85190c 100644 --- a/src/mesa/tnl/t_vb_rendertmp.h +++ b/src/mesa/tnl/t_vb_rendertmp.h @@ -1,4 +1,4 @@ -/* $Id: t_vb_rendertmp.h,v 1.4 2001/01/05 02:26:49 keithw Exp $ */ +/* $Id: t_vb_rendertmp.h,v 1.5 2001/01/08 04:09:42 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -107,7 +107,7 @@ static void TAG(render_line_strip)( GLcontext *ctx, (void) flags; RESET_OCCLUSION; - INIT(GL_LINES); + INIT(GL_LINE_STRIP); for (j=start+1; j<count; j++ ) RENDER_LINE( ELT(j-1), ELT(j) ); @@ -130,7 +130,7 @@ static void TAG(render_line_loop)( GLcontext *ctx, (void) flags; RESET_OCCLUSION; - INIT(GL_LINES); + INIT(GL_LINE_LOOP); if (start+1 < count) { if (TEST_PRIM_BEGIN(flags)) { @@ -160,7 +160,7 @@ static void TAG(render_triangles)( GLcontext *ctx, LOCAL_VARS; (void) flags; - INIT(GL_POLYGON); + INIT(GL_TRIANGLES); if (NEED_EDGEFLAG_SETUP) { for (j=start+2; j<count; j+=3) { /* Leave the edgeflags as supplied by the user. @@ -190,7 +190,7 @@ static void TAG(render_tri_strip)( GLcontext *ctx, if (TEST_PRIM_PARITY(flags)) parity = 1; - INIT(GL_POLYGON); + INIT(GL_TRIANGLE_STRIP); if (NEED_EDGEFLAG_SETUP) { for (j=start+2;j<count;j++,parity^=1) { GLuint ej2 = ELT(j-2+parity); @@ -226,7 +226,7 @@ static void TAG(render_tri_fan)( GLcontext *ctx, LOCAL_VARS; (void) flags; - INIT(GL_POLYGON); + INIT(GL_TRIANGLE_FAN); if (NEED_EDGEFLAG_SETUP) { for (j=start+2;j<count;j++) { /* For trifans, all edges are boundary. @@ -334,7 +334,7 @@ static void TAG(render_quads)( GLcontext *ctx, LOCAL_VARS; (void) flags; - INIT(GL_POLYGON); + INIT(GL_QUADS); if (NEED_EDGEFLAG_SETUP) { for (j=start+3; j<count; j+=4) { /* Use user-specified edgeflags for quads. @@ -359,7 +359,7 @@ static void TAG(render_quad_strip)( GLcontext *ctx, LOCAL_VARS; (void) flags; - INIT(GL_POLYGON); + INIT(GL_QUAD_STRIP); if (NEED_EDGEFLAG_SETUP) { for (j=start+3;j<count;j+=2) { /* All edges are boundary. Set edgeflags to 1, draw the |