summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_span.c
diff options
context:
space:
mode:
authorJouk <[email protected]>2007-10-02 15:17:23 +0200
committerJouk <[email protected]>2007-10-02 15:17:23 +0200
commit584b84256b07e106cd7295495355eb21226465d7 (patch)
tree028d47d265d01f3f96787792fbd41d495d60856c /src/mesa/swrast/s_span.c
parenteb9a5b6d5127858b01ec12672c999e7d25cd7aed (diff)
parentde1d725f442caa4d8ecbac3256b5a33d1f4a1257 (diff)
Merge branch 'master' of git+ssh://[email protected]/git/mesa/mesa
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r--src/mesa/swrast/s_span.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index f23272c2bee..f1e58bd3d81 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -64,8 +64,11 @@ _swrast_span_default_attribs(GLcontext *ctx, SWspan *span)
const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF;
if (ctx->DrawBuffer->Visual.depthBits <= 16)
span->z = FloatToFixed(ctx->Current.RasterPos[2] * depthMax + 0.5F);
- else
- span->z = (GLint) (ctx->Current.RasterPos[2] * depthMax + 0.5F);
+ else {
+ GLfloat tmpf = ctx->Current.RasterPos[2] * depthMax;
+ tmpf = MIN2(tmpf, depthMax);
+ span->z = (GLint)tmpf;
+ }
span->zStep = 0;
span->interpMask |= SPAN_Z;
}
@@ -873,7 +876,7 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span)
#endif
/* we have to wait until after occlusion to do this test */
- if (ctx->Color.DrawBuffer == GL_NONE || ctx->Color.IndexMask == 0) {
+ if (ctx->Color.IndexMask == 0) {
/* write no pixels */
span->arrayMask = origArrayMask;
return;
@@ -1358,7 +1361,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
#if CHAN_BITS == 32
if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) {
- interpolate_int_colors(ctx, span);
+ interpolate_active_attribs(ctx, span, FRAG_BIT_COL0);
}
#else
if ((span->arrayMask & SPAN_RGBA) == 0) {