mesa: Branch 'master' - 6 commits
Brian Paul
brianp at kemper.freedesktop.org
Wed Apr 25 04:19:09 UTC 2007
src/mesa/swrast/s_aaline.c | 6 ++--
src/mesa/swrast/s_aalinetemp.h | 8 +++---
src/mesa/swrast/s_aatriangle.c | 4 +--
src/mesa/swrast/s_aatritemp.h | 18 ++++++-------
src/mesa/swrast/s_lines.c | 41 +++----------------------------
src/mesa/swrast/s_linetemp.h | 34 ++-----------------------
src/mesa/swrast/s_points.c | 10 +++----
src/mesa/swrast/s_pointtemp.h | 12 ++++-----
src/mesa/swrast/s_triangle.c | 54 ++++++++++++-----------------------------
src/mesa/swrast/s_tritemp.h | 19 +++++++-------
10 files changed, 64 insertions(+), 142 deletions(-)
New commits:
diff-tree eca456b63d41700617987ba45a09e8f2168b9577 (from 4003bde6fffc3e5b9e1a115ba952b988dffb099a)
Author: Brian <brian at yutani.localnet.net>
Date: Tue Apr 24 16:57:38 2007 -0600
s/DO_TEXVAR/DO_ATTRIBS/
diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c
index c810951..3bb53dc 100644
--- a/src/mesa/swrast/s_aaline.c
+++ b/src/mesa/swrast/s_aaline.c
@@ -67,7 +67,7 @@ struct LineInfo
GLfloat iPlane[4];
/* DO_SPEC */
GLfloat srPlane[4], sgPlane[4], sbPlane[4];
- /* DO_TEXVAR */
+ /* DO_ATTRIBS */
GLfloat sPlane[FRAG_ATTRIB_MAX][4];
GLfloat tPlane[FRAG_ATTRIB_MAX][4];
GLfloat uPlane[FRAG_ATTRIB_MAX][4];
@@ -499,7 +499,7 @@ segment(GLcontext *ctx,
#define DO_Z
#define DO_FOG
#define DO_RGBA
-#define DO_TEXVAR
+#define DO_ATTRIBS
#include "s_aalinetemp.h"
@@ -507,7 +507,7 @@ segment(GLcontext *ctx,
#define DO_Z
#define DO_FOG
#define DO_RGBA
-#define DO_TEXVAR
+#define DO_ATTRIBS
#define DO_SPEC
#include "s_aalinetemp.h"
diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h
index ef26e9e..402d64b 100644
--- a/src/mesa/swrast/s_aalinetemp.h
+++ b/src/mesa/swrast/s_aalinetemp.h
@@ -80,7 +80,7 @@ NAME(plot)(GLcontext *ctx, struct LineIn
line->span.array->spec[i][GCOMP] = solve_plane_chan(fx, fy, line->sgPlane);
line->span.array->spec[i][BCOMP] = solve_plane_chan(fx, fy, line->sbPlane);
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
ATTRIB_LOOP_BEGIN
GLfloat (*attribArray)[4] = line->span.array->attribs[attr];
GLfloat invQ;
@@ -202,7 +202,7 @@ NAME(line)(GLcontext *ctx, const SWverte
constant_plane(v1->index, line.iPlane);
}
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
{
const GLfloat invW0 = v0->win[3];
const GLfloat invW1 = v1->win[3];
@@ -225,7 +225,7 @@ NAME(line)(GLcontext *ctx, const SWverte
const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
line.texWidth[attr] = (GLfloat) texImage->Width;
- line.texHeight[attr] = (GLfloat) texImage->Height;
+ line.texHeight[attr] = (GLfloat) texImage->Height;
}
ATTRIB_LOOP_END
}
@@ -290,5 +290,5 @@ NAME(line)(GLcontext *ctx, const SWverte
#undef DO_RGBA
#undef DO_INDEX
#undef DO_SPEC
-#undef DO_TEXVAR
+#undef DO_ATTRIBS
#undef NAME
diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c
index 5e3059a..0d95f06 100644
--- a/src/mesa/swrast/s_aatriangle.c
+++ b/src/mesa/swrast/s_aatriangle.c
@@ -408,7 +408,7 @@ tex_aa_tri(GLcontext *ctx,
#define DO_Z
#define DO_FOG
#define DO_RGBA
-#define DO_TEXVAR
+#define DO_ATTRIBS
#include "s_aatritemp.h"
}
@@ -422,7 +422,7 @@ spec_tex_aa_tri(GLcontext *ctx,
#define DO_Z
#define DO_FOG
#define DO_RGBA
-#define DO_TEXVAR
+#define DO_ATTRIBS
#define DO_SPEC
#include "s_aatritemp.h"
}
diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h
index 8ff52cb..39456cc 100644
--- a/src/mesa/swrast/s_aatritemp.h
+++ b/src/mesa/swrast/s_aatritemp.h
@@ -36,7 +36,7 @@
* DO_RGBA - if defined, compute RGBA values
* DO_INDEX - if defined, compute color index values
* DO_SPEC - if defined, compute specular RGB values
- * DO_TEXVAR - if defined, compute texcoords, varying
+ * DO_ATTRIBS - if defined, compute texcoords, varying, etc.
*/
/*void triangle( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv )*/
@@ -70,7 +70,7 @@
#ifdef DO_SPEC
GLfloat srPlane[4], sgPlane[4], sbPlane[4];
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
GLfloat sPlane[FRAG_ATTRIB_MAX][4]; /* texture S */
GLfloat tPlane[FRAG_ATTRIB_MAX][4]; /* texture T */
GLfloat uPlane[FRAG_ATTRIB_MAX][4]; /* texture R */
@@ -181,7 +181,7 @@
}
span.arrayMask |= SPAN_SPEC;
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
{
const GLfloat invW0 = v0->win[3];
const GLfloat invW1 = v1->win[3];
@@ -283,7 +283,7 @@
array->spec[count][GCOMP] = solve_plane_chan(cx, cy, sgPlane);
array->spec[count][BCOMP] = solve_plane_chan(cx, cy, sbPlane);
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
ATTRIB_LOOP_BEGIN
GLfloat invQ = solve_plane_recip(cx, cy, vPlane[attr]);
array->attribs[attr][count][0] = solve_plane(cx, cy, sPlane[attr]) * invQ;
@@ -375,7 +375,7 @@
array->spec[ix][GCOMP] = solve_plane_chan(cx, cy, sgPlane);
array->spec[ix][BCOMP] = solve_plane_chan(cx, cy, sbPlane);
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
ATTRIB_LOOP_BEGIN
GLfloat invQ = solve_plane_recip(cx, cy, vPlane[attr]);
array->attribs[attr][ix][0] = solve_plane(cx, cy, sPlane[attr]) * invQ;
@@ -426,13 +426,13 @@
array->attribs[FRAG_ATTRIB_FOGC][j][0]
= array->attribs[FRAG_ATTRIB_FOGC][j + left][0];
#endif
-#if defined(DO_TEXVAR)
+#if defined(DO_ATTRIBS)
array->lambda[0][j] = array->lambda[0][j + left];
#endif
array->coverage[j] = array->coverage[j + left];
}
}
-#ifdef DO_TEXVAR
+#ifdef DO_ATTRIBS
/* shift texcoords, varying */
{
SWspanarrays *array = span.array;
@@ -482,8 +482,8 @@
#undef DO_SPEC
#endif
-#ifdef DO_TEXVAR
-#undef DO_TEXVAR
+#ifdef DO_ATTRIBS
+#undef DO_ATTRIBS
#endif
#ifdef DO_OCCLUSION_TEST
diff-tree 4003bde6fffc3e5b9e1a115ba952b988dffb099a (from ddcf81990625aae34dfc65fedb17913f279fe9f7)
Author: Brian <brian at yutani.localnet.net>
Date: Tue Apr 24 16:47:33 2007 -0600
get rid of an extra textured triangle function
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index 975d559..fc9d29b 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -124,7 +124,7 @@ _swrast_culltriangle( GLcontext *ctx,
* Render an RGB, GL_DECAL, textured triangle.
* Interpolate S,T only w/out mipmapping or perspective correction.
*
- * No fog.
+ * No fog. No depth testing.
*/
#define NAME simple_textured_triangle
#define INTERP_INT_TEX 1
@@ -850,9 +850,9 @@ fast_persp_span(GLcontext *ctx, SWspan *
/*
- * Render a smooth-shaded, textured, RGBA triangle.
+ * Render an RGBA triangle with arbitrary attributes.
*/
-#define NAME general_textured_triangle
+#define NAME general_triangle
#define INTERP_Z 1
#define INTERP_W 1
#define INTERP_FOG 1
@@ -1092,7 +1092,7 @@ _swrast_choose_triangle( GLcontext *ctx
}
else {
#if (CHAN_BITS == 16 || CHAN_BITS == 32)
- USE(general_textured_triangle);
+ USE(general_triangle);
#else
USE(affine_textured_triangle);
#endif
@@ -1100,7 +1100,7 @@ _swrast_choose_triangle( GLcontext *ctx
}
else {
#if (CHAN_BITS == 16 || CHAN_BITS == 32)
- USE(general_textured_triangle);
+ USE(general_triangle);
#else
USE(persp_textured_triangle);
#endif
@@ -1108,7 +1108,7 @@ _swrast_choose_triangle( GLcontext *ctx
}
else {
/* general case textured triangles */
- USE(general_textured_triangle);
+ USE(general_triangle);
}
}
else {
diff-tree ddcf81990625aae34dfc65fedb17913f279fe9f7 (from 9ede048127ea71282fd97e01516dedcfb03e2a23)
Author: Brian <brian at yutani.localnet.net>
Date: Tue Apr 24 16:47:07 2007 -0600
s/TEXTURE/ATTRIBS/
diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c
index 5879bcc..1401b77 100644
--- a/src/mesa/swrast/s_points.c
+++ b/src/mesa/swrast/s_points.c
@@ -38,7 +38,7 @@
#define RGBA 0x1
#define INDEX 0x2
#define SMOOTH 0x4
-#define TEXTURE 0x8
+#define ATTRIBS 0x8
#define SPECULAR 0x10
#define LARGE 0x20
#define ATTENUATE 0x40
@@ -104,7 +104,7 @@
/*
* Textured RGBA points.
*/
-#define FLAGS (RGBA | LARGE | TEXTURE | SPECULAR)
+#define FLAGS (RGBA | LARGE | ATTRIBS | SPECULAR)
#define NAME textured_rgba_point
#include "s_pointtemp.h"
@@ -112,7 +112,7 @@
/*
* Antialiased points with texture mapping.
*/
-#define FLAGS (RGBA | SMOOTH | TEXTURE | SPECULAR)
+#define FLAGS (RGBA | SMOOTH | ATTRIBS | SPECULAR)
#define NAME antialiased_tex_rgba_point
#include "s_pointtemp.h"
@@ -128,7 +128,7 @@
/*
* Distance attenuated, textured RGBA points.
*/
-#define FLAGS (RGBA | ATTENUATE | TEXTURE | SPECULAR)
+#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SPECULAR)
#define NAME atten_textured_rgba_point
#include "s_pointtemp.h"
@@ -136,7 +136,7 @@
/*
* Distance attenuated, antialiased points with or without texture mapping.
*/
-#define FLAGS (RGBA | ATTENUATE | TEXTURE | SMOOTH)
+#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SMOOTH)
#define NAME atten_antialiased_rgba_point
#include "s_pointtemp.h"
diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h
index 500b3fe..d118a53 100644
--- a/src/mesa/swrast/s_pointtemp.h
+++ b/src/mesa/swrast/s_pointtemp.h
@@ -39,14 +39,14 @@
*
* RGBA = do rgba instead of color index
* SMOOTH = do antialiasing
- * TEXTURE = do texture coords
+ * ATTRIBS = general attributes (texcoords, etc)
* SPECULAR = do separate specular color
* LARGE = do points with diameter > 1 pixel
* ATTENUATE = compute point size attenuation
* SPRITE = GL_ARB_point_sprite / GL_NV_point_sprite
*
* Notes: LARGE and ATTENUATE are exclusive of each other.
- * TEXTURE requires RGBA
+ * ATTRIBS requires RGBA
*/
@@ -86,7 +86,7 @@ NAME ( GLcontext *ctx, const SWvertex *v
#if FLAGS & INDEX
const GLuint colorIndex = (GLuint) vert->index; /* XXX round? */
#endif
-#if FLAGS & TEXTURE
+#if FLAGS & ATTRIBS
GLfloat attrib[FRAG_ATTRIB_MAX][4]; /* texture & varying */
#endif
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -117,7 +117,7 @@ NAME ( GLcontext *ctx, const SWvertex *v
#if FLAGS & INDEX
span->arrayMask |= SPAN_INDEX;
#endif
-#if FLAGS & TEXTURE
+#if FLAGS & ATTRIBS
span->arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
if (ctx->FragmentProgram._Active) {
/* Don't divide texture s,t,r by q (use TXP to do that) */
@@ -272,7 +272,7 @@ NAME ( GLcontext *ctx, const SWvertex *v
#if FLAGS & INDEX
span->array->index[count] = colorIndex;
#endif
-#if FLAGS & TEXTURE
+#if FLAGS & ATTRIBS
ATTRIB_LOOP_BEGIN
COPY_4V(span->array->attribs[attr][count], attrib[attr]);
if (attr < FRAG_ATTRIB_VAR0) {
@@ -397,7 +397,7 @@ NAME ( GLcontext *ctx, const SWvertex *v
#if FLAGS & INDEX
span->array->index[count] = colorIndex;
#endif
-#if FLAGS & TEXTURE
+#if FLAGS & ATTRIBS
ATTRIB_LOOP_BEGIN
COPY_4V(span->array->attribs[attr][count], attribs[attr]);
ATTRIB_LOOP_END
diff-tree 9ede048127ea71282fd97e01516dedcfb03e2a23 (from 97693436a5740fb56c29fcd1cb0a1aa562349902)
Author: Brian <brian at yutani.localnet.net>
Date: Tue Apr 24 16:40:54 2007 -0600
trim down the number of line drawing functions, special cases
diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c
index 7b2a52b..80702e4 100644
--- a/src/mesa/swrast/s_lines.c
+++ b/src/mesa/swrast/s_lines.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.3
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -171,34 +171,13 @@ draw_wide_line( GLcontext *ctx, SWspan *
#include "s_linetemp.h"
-/* Single-texture line, w/ fog, Z, specular, etc. */
+/* General-purpose textured line (any/all features). */
#define NAME textured_line
#define INTERP_RGBA
-#define INTERP_Z
-#define INTERP_FOG
-#define INTERP_TEX
-#define RENDER_SPAN(span) \
- if (ctx->Line.StippleFlag) { \
- span.arrayMask |= SPAN_MASK; \
- compute_stipple_mask(ctx, span.end, span.array->mask); \
- } \
- if (ctx->Line._Width > 1.0) { \
- draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \
- } \
- else { \
- _swrast_write_rgba_span(ctx, &span); \
- }
-#include "s_linetemp.h"
-
-
-/* Multi-texture or separate specular line, w/ fog, Z, specular, etc. */
-#define NAME multitextured_line
-#define INTERP_RGBA
#define INTERP_SPEC
#define INTERP_Z
#define INTERP_FOG
-#define INTERP_MULTITEX
-#define INTERP_VARYING
+#define INTERP_ATTRIBS
#define RENDER_SPAN(span) \
if (ctx->Line.StippleFlag) { \
span.arrayMask |= SPAN_MASK; \
@@ -251,8 +230,6 @@ _mesa_print_line_function(GLcontext *ctx
_mesa_printf("general_rgba_line\n");
else if (swrast->Line == textured_line)
_mesa_printf("textured_line\n");
- else if (swrast->Line == multitextured_line)
- _mesa_printf("multitextured_line\n");
else
_mesa_printf("Driver func %p\n", (void *(*)()) swrast->Line);
}
@@ -302,15 +279,7 @@ _swrast_choose_line( GLcontext *ctx )
else if (ctx->Texture._EnabledCoordUnits
|| ctx->FragmentProgram._Current) {
/* textured lines */
- if (ctx->Texture._EnabledCoordUnits > 0x1
- || NEED_SECONDARY_COLOR(ctx)
- || ctx->FragmentProgram._Current) {
- /* multi-texture and/or separate specular color */
- USE(multitextured_line);
- }
- else {
- USE(textured_line);
- }
+ USE(textured_line);
}
else if (ctx->Depth.Test || swrast->_FogEnabled || ctx->Line._Width != 1.0
|| ctx->Line.StippleFlag) {
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index 76da446..b6e8f28 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -35,9 +35,7 @@
* INTERP_RGBA - if defined, interpolate RGBA values
* INTERP_SPEC - if defined, interpolate specular RGB values
* INTERP_INDEX - if defined, interpolate color index values
- * INTERP_TEX - if defined, interpolate unit 0 texcoords
- * INTERP_MULTITEX - if defined, interpolate multi-texcoords
- * INTERP_VARYING - if defined, interpolate GLSL varyings
+ * INTERP_ATTRIBS - if defined, interpolate attribs (texcoords, varying, etc)
*
* When one can directly address pixels in the color buffer the following
* macros can be defined and used to directly compute pixel addresses during
@@ -284,32 +282,7 @@ NAME( GLcontext *ctx, const SWvertex *ve
span.attrStepX[FRAG_ATTRIB_FOGC][0] = (vert1->attrib[FRAG_ATTRIB_FOGC][0]
- vert0->attrib[FRAG_ATTRIB_FOGC][0]) / numPixels;
#endif
-#ifdef INTERP_TEX
- interpFlags |= SPAN_TEXTURE;
- {
- const GLfloat invw0 = vert0->win[3];
- const GLfloat invw1 = vert1->win[3];
- const GLfloat invLen = 1.0F / numPixels;
- GLfloat ds, dt, dr, dq;
- span.attrStart[FRAG_ATTRIB_TEX0][0] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][0];
- span.attrStart[FRAG_ATTRIB_TEX0][1] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][1];
- span.attrStart[FRAG_ATTRIB_TEX0][2] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][2];
- span.attrStart[FRAG_ATTRIB_TEX0][3] = invw0 * vert0->attrib[FRAG_ATTRIB_TEX0][3];
- ds = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][0]) - span.attrStart[FRAG_ATTRIB_TEX0][0];
- dt = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][1]) - span.attrStart[FRAG_ATTRIB_TEX0][1];
- dr = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][2]) - span.attrStart[FRAG_ATTRIB_TEX0][2];
- dq = (invw1 * vert1->attrib[FRAG_ATTRIB_TEX0][3]) - span.attrStart[FRAG_ATTRIB_TEX0][3];
- span.attrStepX[FRAG_ATTRIB_TEX0][0] = ds * invLen;
- span.attrStepX[FRAG_ATTRIB_TEX0][1] = dt * invLen;
- span.attrStepX[FRAG_ATTRIB_TEX0][2] = dr * invLen;
- span.attrStepX[FRAG_ATTRIB_TEX0][3] = dq * invLen;
- span.attrStepY[FRAG_ATTRIB_TEX0][0] = 0.0F;
- span.attrStepY[FRAG_ATTRIB_TEX0][1] = 0.0F;
- span.attrStepY[FRAG_ATTRIB_TEX0][2] = 0.0F;
- span.attrStepY[FRAG_ATTRIB_TEX0][3] = 0.0F;
- }
-#endif
-#if defined(INTERP_MULTITEX) || defined(INTERP_VARYING)
+#if defined(INTERP_ATTRIBS)
interpFlags |= (SPAN_TEXTURE | SPAN_VARYING);
{
const GLfloat invLen = 1.0F / numPixels;
@@ -443,8 +416,7 @@ NAME( GLcontext *ctx, const SWvertex *ve
#undef INTERP_FOG
#undef INTERP_RGBA
#undef INTERP_SPEC
-#undef INTERP_TEX
-#undef INTERP_MULTITEX
+#undef INTERP_ATTRIBS
#undef INTERP_INDEX
#undef PIXEL_ADDRESS
#undef PIXEL_TYPE
diff-tree 97693436a5740fb56c29fcd1cb0a1aa562349902 (from 8a8a5bd104e8cd9362415db77d5f6a3945939589)
Author: Brian <brian at yutani.localnet.net>
Date: Tue Apr 24 16:20:50 2007 -0600
only need one CI-mode triangle function
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index dbb634e..975d559 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -67,24 +67,9 @@ _swrast_culltriangle( GLcontext *ctx,
/*
- * Render a flat-shaded color index triangle.
+ * Render a smooth or flat-shaded color index triangle.
*/
-#define NAME flat_ci_triangle
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define SETUP_CODE \
- span.interpMask |= SPAN_INDEX; \
- span.index = FloatToFixed(v2->index);\
- span.indexStep = 0;
-#define RENDER_SPAN( span ) _swrast_write_index_span(ctx, &span);
-#include "s_tritemp.h"
-
-
-
-/*
- * Render a smooth-shaded color index triangle.
- */
-#define NAME smooth_ci_triangle
+#define NAME ci_triangle
#define INTERP_Z 1
#define INTERP_FOG 1
#define INTERP_INDEX 1
@@ -1054,6 +1039,11 @@ _swrast_choose_triangle( GLcontext *ctx
}
}
+ if (!rgbmode) {
+ USE(ci_triangle);
+ return;
+ }
+
if (ctx->Texture._EnabledCoordUnits ||
ctx->FragmentProgram._Current ||
ctx->ATIFragmentShader._Enabled) {
@@ -1125,21 +1115,11 @@ _swrast_choose_triangle( GLcontext *ctx
ASSERT(!ctx->Texture._EnabledCoordUnits);
if (ctx->Light.ShadeModel==GL_SMOOTH) {
/* smooth shaded, no texturing, stippled or some raster ops */
- if (rgbmode) {
- USE(smooth_rgba_triangle);
- }
- else {
- USE(smooth_ci_triangle);
- }
+ USE(smooth_rgba_triangle);
}
else {
/* flat shaded, no texturing, stippled or some raster ops */
- if (rgbmode) {
- USE(flat_rgba_triangle);
- }
- else {
- USE(flat_ci_triangle);
- }
+ USE(flat_rgba_triangle);
}
}
}
diff-tree 8a8a5bd104e8cd9362415db77d5f6a3945939589 (from 3e5eda9ee9ff7c0e393dcc5ecb88198f1990c32f)
Author: Brian <brian at yutani.localnet.net>
Date: Tue Apr 24 16:16:25 2007 -0600
s/INTERP_TEX/INTERP_ATTRIBS/
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index 3b7960b..dbb634e 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -803,7 +803,7 @@ fast_persp_span(GLcontext *ctx, SWspan *
#define INTERP_FOG 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
-#define INTERP_TEX 1
+#define INTERP_ATTRIBS 1
#define SETUP_CODE \
struct persp_info info; \
@@ -874,7 +874,7 @@ fast_persp_span(GLcontext *ctx, SWspan *
#define INTERP_RGB 1
#define INTERP_SPEC 1
#define INTERP_ALPHA 1
-#define INTERP_TEX 1
+#define INTERP_ATTRIBS 1
#define RENDER_SPAN( span ) _swrast_write_rgba_span(ctx, &span);
#include "s_tritemp.h"
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index 97c7942..b8601bd 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -38,7 +38,8 @@
* INTERP_INDEX - if defined, interpolate color index values
* INTERP_INT_TEX - if defined, interpolate integer ST texcoords
* (fast, simple 2-D texture mapping)
- * INTERP_TEX - if defined, interpolate texcoords and varying vars
+ * INTERP_ATTRIBS - if defined, interpolate arbitrary attribs (texcoords,
+ * varying vars, etc)
* NOTE: OpenGL STRQ = Mesa STUV (R was taken for red)
*
* When one can directly address pixels in the color buffer the following
@@ -601,7 +602,7 @@ static void NAME(GLcontext *ctx, const S
span.intTexStep[1] = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_TEX0][1]);
}
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
span.interpMask |= (SPAN_TEXTURE | SPAN_VARYING);
{
/* win[3] is 1/W */
@@ -719,7 +720,7 @@ static void NAME(GLcontext *ctx, const S
GLfixed sLeft=0, dsOuter=0, dsInner;
GLfixed tLeft=0, dtOuter=0, dtInner;
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
GLfloat sLeft[FRAG_ATTRIB_MAX];
GLfloat tLeft[FRAG_ATTRIB_MAX];
GLfloat uLeft[FRAG_ATTRIB_MAX];
@@ -986,7 +987,7 @@ static void NAME(GLcontext *ctx, const S
dtOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_TEX0][1] + dxOuter * span.attrStepX[FRAG_ATTRIB_TEX0][1]);
}
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
ATTRIB_LOOP_BEGIN
const GLfloat invW = vLower->win[3];
const GLfloat s0 = vLower->attrib[attr][0] * invW;
@@ -1057,7 +1058,7 @@ static void NAME(GLcontext *ctx, const S
dsInner = dsOuter + span.intTexStep[0];
dtInner = dtOuter + span.intTexStep[1];
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
ATTRIB_LOOP_BEGIN
dsInner[attr] = dsOuter[attr] + span.attrStepX[attr][0];
dtInner[attr] = dtOuter[attr] + span.attrStepX[attr][1];
@@ -1106,7 +1107,7 @@ static void NAME(GLcontext *ctx, const S
span.intTex[1] = tLeft;
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
ATTRIB_LOOP_BEGIN
span.attrStart[attr][0] = sLeft[attr];
span.attrStart[attr][1] = tLeft[attr];
@@ -1194,7 +1195,7 @@ static void NAME(GLcontext *ctx, const S
sLeft += dsOuter;
tLeft += dtOuter;
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
ATTRIB_LOOP_BEGIN
sLeft[attr] += dsOuter[attr];
tLeft[attr] += dtOuter[attr];
@@ -1239,7 +1240,7 @@ static void NAME(GLcontext *ctx, const S
sLeft += dsInner;
tLeft += dtInner;
#endif
-#ifdef INTERP_TEX
+#ifdef INTERP_ATTRIBS
ATTRIB_LOOP_BEGIN
sLeft[attr] += dsInner[attr];
tLeft[attr] += dtInner[attr];
@@ -1276,7 +1277,7 @@ static void NAME(GLcontext *ctx, const S
#undef INTERP_SPEC
#undef INTERP_INDEX
#undef INTERP_INT_TEX
-#undef INTERP_TEX
+#undef INTERP_ATTRIBS
#undef TEX_UNIT_LOOP
#undef VARYING_LOOP
More information about the mesa-commit
mailing list