summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-10-17 17:03:00 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-10-17 17:03:00 +0000
commit1e3223c02a2f6155beb5784cadbea1f46703829a (patch)
tree5bf7caa415933a9f0cd239dd382a58f06ec8828c /src
parent8dff54e71d3ea22813e416910c3c99f7e3abbb2f (diff)
Fix CHAN_BITS=32 issues.
Save/restore array->ChanType in case colors are converted.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/swrast/s_span.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 59a5361632..a8cc268a95 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -169,6 +169,7 @@ interpolate_colors(GLcontext *ctx, SWspan *span, GLboolean specular)
if (span->interpMask & SPAN_FLAT) {
/* constant color */
switch (span->array->ChanType) {
+#if CHAN_BITS != 32
case GL_UNSIGNED_BYTE:
{
GLubyte (*rgba)[4] = specular
@@ -213,6 +214,7 @@ interpolate_colors(GLcontext *ctx, SWspan *span, GLboolean specular)
}
}
break;
+#endif
case GL_FLOAT:
{
GLfloat (*rgba)[4] = specular ?
@@ -243,6 +245,7 @@ interpolate_colors(GLcontext *ctx, SWspan *span, GLboolean specular)
else {
/* interpolate */
switch (span->array->ChanType) {
+#if CHAN_BITS != 32
case GL_UNSIGNED_BYTE:
{
GLubyte (*rgba)[4] = specular
@@ -319,6 +322,7 @@ interpolate_colors(GLcontext *ctx, SWspan *span, GLboolean specular)
}
}
break;
+#endif
case GL_FLOAT:
{
GLfloat (*rgba)[4] = specular ?
@@ -1503,6 +1507,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
const GLuint numDrawBuffers = fb->_NumColorDrawBuffers[output];
GLchan rgbaSave[MAX_WIDTH][4];
GLuint buf;
+ const GLenum chanType = span->array->ChanType; /* save */
if (numDrawBuffers > 0) {
if (fb->_ColorDrawBuffers[output][0]->DataType
@@ -1553,6 +1558,8 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
4 * span->end * sizeof(GLchan));
}
} /* for buf */
+
+ span->array->ChanType = chanType; /* restore */
}
span->interpMask = origInterpMask;