From efda5cb6263631175aa2efe46df9322b3c5775ee Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 26 Jul 2007 08:22:09 -0600 Subject: don't use rgba_line() if CHAN_BITS==32 --- src/mesa/swrast/s_lines.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 15ef6233ed..3de438760b 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -279,7 +279,11 @@ _swrast_choose_line( GLcontext *ctx ) || ctx->Line.StippleFlag) { /* no texture, but Z, fog, width>1, stipple, etc. */ if (rgbmode) +#if CHAN_BITS == 32 + USE(general_line); +#else USE(rgba_line); +#endif else USE(ci_line); } -- cgit v1.2.3 From 51b728cf9aff383142a2a1e220a7d8963d1ca189 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 26 Jul 2007 08:22:28 -0600 Subject: fix color interpolation for CHAN_BITS==32 --- src/mesa/swrast/s_span.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index f23272c2be..cfc65bee87 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1358,7 +1358,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) { -- cgit v1.2.3 From 0ed3ff5011442facdaccdb84518d7712833f9dab Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 7 Aug 2007 08:17:02 +0100 Subject: fix even-sized point positioning (bug 11874) --- src/mesa/swrast/s_points.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index 4768fbea97..21316372e8 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -172,9 +172,9 @@ sprite_point(GLcontext *ctx, const SWvertex *vert) } else { /* even size */ - xmin = (GLint) x - iRadius + 1; + xmin = (GLint) x - iRadius; xmax = xmin + iSize - 1; - ymin = (GLint) y - iRadius + 1; + ymin = (GLint) y - iRadius; ymax = ymin + iSize - 1; } @@ -418,9 +418,9 @@ large_point(GLcontext *ctx, const SWvertex *vert) } else { /* even size */ - xmin = (GLint) x - iRadius + 1; + xmin = (GLint) x - iRadius; xmax = xmin + iSize - 1; - ymin = (GLint) y - iRadius + 1; + ymin = (GLint) y - iRadius; ymax = ymin + iSize - 1; } -- cgit v1.2.3 From c5a5d12743b4921ab9c01ee69fa6a06b6b4d716a Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 16 Aug 2007 16:43:31 +0100 Subject: remove reference to ctx->Color.DrawBuffer --- src/mesa/swrast/s_span.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index cfc65bee87..bbde0025f4 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -873,7 +873,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; -- cgit v1.2.3 From 032707eeca2e6a0fd931ebd9ef4831bf30baf183 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 14 Sep 2007 09:57:57 -0600 Subject: fix copypixels overlap test bug (#12417) --- src/mesa/swrast/s_copypix.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index bbe1081860..218a3b5590 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -71,13 +71,20 @@ regions_overlap(GLint srcx, GLint srcy, } else { /* add one pixel of slop when zooming, just to be safe */ - if ((srcx > dstx + (width * zoomX) + 1) || (srcx + width + 1 < dstx)) { + if (srcx > (dstx + ((zoomX > 0.0F) ? (width * zoomX + 1.0F) : 0.0F))) { + /* src is completely right of dest */ + return GL_FALSE; + } + else if (srcx + width + 1.0F < dstx + ((zoomX > 0.0F) ? 0.0F : (width * zoomX))) { + /* src is completely left of dest */ return GL_FALSE; } else if ((srcy < dsty) && (srcy + height < dsty + (height * zoomY))) { + /* src is completely below dest */ return GL_FALSE; } else if ((srcy > dsty) && (srcy + height > dsty + (height * zoomY))) { + /* src is completely above dest */ return GL_FALSE; } else { -- cgit v1.2.3 From e21d2c6ef300c7661f49c50b4c68b4f205795f4a Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Tue, 18 Sep 2007 09:32:44 +0800 Subject: mesa: Always use the original mask to update stencil buffer in stencil_and_ztest_pixels. fix #12263 --- src/mesa/swrast/s_stencil.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index d0cbdd6917..cae1e09929 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -923,6 +923,8 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) ASSERT(rb->DataType == GL_UNSIGNED_BYTE); _swrast_get_values(ctx, rb, n, x, y, stencil, sizeof(GLubyte)); + _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); + (void) do_stencil_test(ctx, face, n, stencil, mask); if (ctx->Depth.Test == GL_FALSE) { @@ -930,11 +932,12 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) n, stencil, mask); } else { - _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); + GLubyte tmpMask[MAX_WIDTH]; + _mesa_memcpy(tmpMask, mask, n * sizeof(GLubyte)); _swrast_depth_test_span(ctx, span); - compute_pass_fail_masks(n, origMask, mask, passMask, failMask); + compute_pass_fail_masks(n, tmpMask, mask, passMask, failMask); if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) { apply_stencil_op(ctx, ctx->Stencil.ZFailFunc[face], face, -- cgit v1.2.3 From 6254be9b7144821e044d3fbade514fa0358db693 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Thu, 27 Sep 2007 15:52:01 +0800 Subject: mesa: make sure the gotten value isn't greater than the max depth buffer value on 64bit system. fix bug #12095 --- src/mesa/swrast/s_span.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index bbde0025f4..f1e58bd3d8 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; } -- cgit v1.2.3 From 4f9d29cd4e876cd202a7d3e81f6d91fc7f9625a2 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 27 Sep 2007 10:23:32 -0600 Subject: tweak point rast to fix conform failure --- src/mesa/swrast/s_points.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index 21316372e8..d54adc8fd1 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -172,9 +172,10 @@ sprite_point(GLcontext *ctx, const SWvertex *vert) } else { /* even size */ - xmin = (GLint) x - iRadius; + /* 0.501 factor allows conformance to pass */ + xmin = (GLint) (x + 0.501) - iRadius; xmax = xmin + iSize - 1; - ymin = (GLint) y - iRadius; + ymin = (GLint) (y + 0.501) - iRadius; ymax = ymin + iSize - 1; } @@ -418,9 +419,10 @@ large_point(GLcontext *ctx, const SWvertex *vert) } else { /* even size */ - xmin = (GLint) x - iRadius; + /* 0.501 factor allows conformance to pass */ + xmin = (GLint) (x + 0.501) - iRadius; xmax = xmin + iSize - 1; - ymin = (GLint) y - iRadius; + ymin = (GLint) (y + 0.501) - iRadius; ymax = ymin + iSize - 1; } -- cgit v1.2.3