summaryrefslogtreecommitdiff
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2001-02-16 18:14:41 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2001-02-16 18:14:41 +0000
commit46b0988c673b28e072fd0cbf477632a9ab6f9f18 (patch)
tree3463116da957c6f13dcb0b415ca8476640503fc7 /src/mesa/tnl
parent2448fc7deeaa870d879de17158f243f239c05b15 (diff)
Allow swrast to cope (fairly) cleanly with GL_SEPERATE_SPECULAR when
texturing is not enabled, and without requiring the two colors be added externally. As a part of this, collapsed the decomposition of quads into triangles inside swrast to be hardwired into _swrast_Quad; removed s_quads.[ch]. Removed checks on texture state from t_vb_light.c, which was previously required by swrast. Moved the t_dd_ templates to a new directory.
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_vb_light.c13
-rw-r--r--src/mesa/tnl/t_vb_lighttmp.h60
-rw-r--r--src/mesa/tnl/t_vb_render.c20
3 files changed, 29 insertions, 64 deletions
diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c
index 00beb53123..ce180880fb 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.7 2001/02/16 00:35:35 keithw Exp $ */
+/* $Id: t_vb_light.c,v 1.8 2001/02/16 18:14:42 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -174,8 +174,7 @@ static GLboolean run_validate_lighting( GLcontext *ctx,
if (ctx->Visual.rgbMode) {
if (ctx->Light._NeedVertices) {
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR &&
- ctx->Texture._ReallyEnabled)
+ if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
tab = _tnl_light_spec_tab;
else
tab = _tnl_light_tab;
@@ -271,8 +270,7 @@ static void check_lighting( GLcontext *ctx, struct gl_pipeline_stage *stage )
stage->inputs |= VERT_RGBA;
stage->outputs = VERT_RGBA;
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR &&
- ctx->Texture._ReallyEnabled)
+ if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
stage->outputs |= VERT_SPEC_RGB;
}
}
@@ -309,9 +307,8 @@ static void dtr( struct gl_pipeline_stage *stage )
const struct gl_pipeline_stage _tnl_lighting_stage =
{
"lighting",
- _NEW_LIGHT|_NEW_TEXTURE, /* recheck; texture for seperate_specular */
- _NEW_LIGHT|_NEW_MODELVIEW|
- _NEW_TEXTURE, /* recalc -- modelview dependency
+ _NEW_LIGHT, /* recheck */
+ _NEW_LIGHT|_NEW_MODELVIEW, /* recalc -- modelview dependency
* otherwise not captured by inputs
* (which may be VERT_OBJ) */
0,0,0, /* active, inputs, outputs */
diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h
index 50bbedd8a0..b9b50219b3 100644
--- a/src/mesa/tnl/t_vb_lighttmp.h
+++ b/src/mesa/tnl/t_vb_lighttmp.h
@@ -1,4 +1,4 @@
-/* $Id: t_vb_lighttmp.h,v 1.7 2001/02/16 00:35:35 keithw Exp $ */
+/* $Id: t_vb_lighttmp.h,v 1.8 2001/02/16 18:14:42 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -524,19 +524,20 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
if (stage->changed_inputs == 0)
return;
- if ( CHECK_COLOR_MATERIAL(j) )
- gl_update_color_material( ctx, (GLchan *)CMcolor[j] );
+ do {
- if ( CHECK_MATERIAL(j) )
- gl_update_material( ctx, new_material[j], new_material_mask[j] );
+ if ( CHECK_COLOR_MATERIAL(j) )
+ gl_update_color_material( ctx, (GLchan *)CMcolor[j] );
+
+ if ( CHECK_MATERIAL(j) )
+ gl_update_material( ctx, new_material[j], new_material_mask[j] );
- if ( CHECK_VALIDATE(j) )
- gl_validate_all_lighting_tables( ctx );
+ if ( CHECK_VALIDATE(j) )
+ gl_validate_all_lighting_tables( ctx );
- baseubyte[0][3] = ctx->Light._BaseAlpha[0];
- baseubyte[1][3] = ctx->Light._BaseAlpha[1];
+ baseubyte[0][3] = ctx->Light._BaseAlpha[0];
+ baseubyte[1][3] = ctx->Light._BaseAlpha[1];
- do {
/* No attenuation, so incoporate _MatAmbient into base color.
*/
{
@@ -596,17 +597,6 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx,
STRIDE_F(normal, NSTRIDE);
}
- /* Have to recompute our base colors on material change.
- */
- if ( CHECK_MATERIAL(j) )
- gl_update_material( ctx, new_material[j], new_material_mask[j] );
-
- if ( CHECK_COLOR_MATERIAL(j) )
- gl_update_color_material( ctx, (GLchan *)CMcolor[j] );
-
- if ( CHECK_VALIDATE(j) )
- gl_validate_all_lighting_tables( ctx );
-
} while (!CHECK_END_VB(j));
}
@@ -651,19 +641,20 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
if (stage->changed_inputs == 0)
return;
- if ( CHECK_COLOR_MATERIAL(j) )
- gl_update_color_material( ctx, *CMcolor );
-
- if ( CHECK_MATERIAL(j) )
- gl_update_material( ctx, new_material[j], new_material_mask[j] );
-
- if ( CHECK_VALIDATE(j) )
- gl_validate_all_lighting_tables( ctx );
-
do {
do {
GLfloat sum[2][3];
+ if ( CHECK_COLOR_MATERIAL(j) )
+ gl_update_color_material( ctx, CMcolor[j] );
+
+ if ( CHECK_MATERIAL(j) )
+ gl_update_material( ctx, new_material[j], new_material_mask[j] );
+
+ if ( CHECK_VALIDATE(j) )
+ gl_validate_all_lighting_tables( ctx );
+
+
COPY_3V(sum[0], ctx->Light._BaseColor[0]);
if (IDX & LIGHT_TWOSIDE)
COPY_3V(sum[1], ctx->Light._BaseColor[1]);
@@ -721,15 +712,6 @@ static void TAG(light_fast_rgba)( GLcontext *ctx,
STRIDE_F(normal, NSTRIDE);
}
- if ( CHECK_COLOR_MATERIAL(j) )
- gl_update_color_material( ctx, CMcolor[j] );
-
- if ( CHECK_MATERIAL(j) )
- gl_update_material( ctx, new_material[j], new_material_mask[j] );
-
- if ( CHECK_VALIDATE(j) )
- gl_validate_all_lighting_tables( ctx );
-
} while (!CHECK_END_VB(j));
}
diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c
index 9412a0fcb9..25e03a8c4e 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.13 2001/02/16 00:35:35 keithw Exp $ */
+/* $Id: t_vb_render.c,v 1.14 2001/02/16 18:14:42 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -63,18 +63,6 @@
-/* typedef void (*clip_line_func)( GLcontext *ctx, */
-/* GLuint i, GLuint j, */
-/* GLubyte mask); */
-
-/* typedef void (*clip_poly_func)( GLcontext *ctx, */
-/* GLuint n, GLuint vlist[], */
-/* GLubyte mask ); */
-
-
-
-
-
/**********************************************************************/
/* Clip single primitives */
/**********************************************************************/
@@ -184,7 +172,7 @@ do { \
#define TAG(x) clip_##x##_verts
#define INIT(x) ctx->Driver.RenderPrimitive( ctx, x )
#define RESET_STIPPLE if (stipple) ctx->Driver.ResetLineStipple( ctx )
-#define RESET_OCCLUSION ctx->OcclusionResult = GL_TRUE;
+#define RESET_OCCLUSION ctx->OcclusionResult = GL_TRUE
#define PRESERVE_VB_DEFS
#include "t_vb_rendertmp.h"
@@ -268,7 +256,7 @@ static void clip_elt_triangles( GLcontext *ctx,
(void) elt;
#define RESET_STIPPLE ctx->Driver.ResetLineStipple( ctx )
-#define RESET_OCCLUSION ctx->OcclusionResult = GL_TRUE;
+#define RESET_OCCLUSION ctx->OcclusionResult = GL_TRUE
#define INIT(x) ctx->Driver.RenderPrimitive( ctx, x )
#define RENDER_TAB_QUALIFIER
#define PRESERVE_VB_DEFS
@@ -337,8 +325,6 @@ static GLboolean run_render( GLcontext *ctx,
length= VB->PrimitiveLength[i];
ASSERT(length || (flags & PRIM_LAST));
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1);
-/* fprintf(stderr, "Render %s %d..%d\n", */
-/* _mesa_prim_name[flags&PRIM_MODE_MASK], i, i+length); */
if (length)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
}