summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-07-06 16:51:19 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-07-06 16:55:40 -0600
commita164d3aee063580503e5e9a77980059d52c486d7 (patch)
treef689a0cca51050466f8cae32ecbcd7e9124cfc2e
parent0bf2479aef5def4d01bfc55b08992f41664f1431 (diff)
In _swsetup_Translate(), update dest->attrib[FRAG_ATTRIB_COL0].
Also, check if we're in RGB vs. CI mode. This fixes a problem with incorrect rendering color seen with the redbook/polys demo.
-rw-r--r--src/mesa/swrast_setup/ss_context.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c
index f8a1cadfa5..a9c7d941e5 100644
--- a/src/mesa/swrast_setup/ss_context.c
+++ b/src/mesa/swrast_setup/ss_context.c
@@ -280,26 +280,29 @@ _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest )
/** XXX try to limit these loops someday */
for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
- _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_TEX0+i,
+ _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_TEX0 + i,
dest->attrib[FRAG_ATTRIB_TEX0 + i] );
for (i = 0 ; i < ctx->Const.MaxVarying ; i++)
- _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_GENERIC0+i,
+ _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_GENERIC0 + i,
dest->attrib[FRAG_ATTRIB_VAR0 + i] );
- _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0, tmp );
- /* XXX need float color FRAG_ATTRIB_COL0?? */
- UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp );
+ if (ctx->Visual.rgbMode) {
+ _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0,
+ dest->attrib[FRAG_ATTRIB_COL0] );
+ UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp );
- _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1, tmp );
- COPY_4V(dest->attrib[FRAG_ATTRIB_COL1], tmp);
+ _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1,
+ dest->attrib[FRAG_ATTRIB_COL1]);
+ }
+ else {
+ _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR_INDEX, tmp );
+ dest->attrib[FRAG_ATTRIB_CI][0] = tmp[0];
+ }
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp );
dest->attrib[FRAG_ATTRIB_FOGC][0] = tmp[0];
- _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR_INDEX, tmp );
- dest->attrib[FRAG_ATTRIB_CI][0] = tmp[0];
-
/* XXX See _tnl_get_attr about pointsize ... */
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POINTSIZE, tmp );
dest->pointSize = tmp[0];