summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_span.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2009-10-28 16:35:16 -0700
committerEric Anholt <[email protected]>2009-10-29 10:01:17 -0700
commit32ec3f26731ac998b6fda7ce596ec568d6f76eeb (patch)
tree9e19761b9b67db1bbdebdf44f075d672bf7f4686 /src/mesa/swrast/s_span.c
parent6eb6a0e9cbed6ba5543d54e277f7ac11a0612070 (diff)
mesa: Mostly fix swrast's ARB_depth_clamp support.
I'd written a testcase for the hard part of the extension enablement, so naturally the easy stuff was completely broken. There are still issues, as I'm seeing FLOAT_TO_UINT(max_f) == 0x0 when max_f == 1.0, but it gets piglit depth-clamp-range closer to success.
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r--src/mesa/swrast/s_span.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 704230d1d7b..d36c8132f63 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -880,14 +880,14 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span)
stipple_polygon_span(ctx, span);
}
- if (ctx->Transform.DepthClamp)
- _swrast_depth_clamp_span(ctx, span);
-
/* Stencil and Z testing */
if (ctx->Stencil._Enabled || ctx->Depth.Test) {
if (!(span->arrayMask & SPAN_Z))
_swrast_span_interpolate_z(ctx, span);
+ if (ctx->Transform.DepthClamp)
+ _swrast_depth_clamp_span(ctx, span);
+
if (ctx->Stencil._Enabled) {
if (!_swrast_stencil_and_ztest_span(ctx, span)) {
span->arrayMask = origArrayMask;
@@ -1356,6 +1356,10 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
if (ctx->Stencil._Enabled || ctx->Depth.Test) {
if (!(span->arrayMask & SPAN_Z))
_swrast_span_interpolate_z(ctx, span);
+
+ if (ctx->Transform.DepthClamp)
+ _swrast_depth_clamp_span(ctx, span);
+
if (ctx->Stencil._Enabled) {
/* Combined Z/stencil tests */
if (!_swrast_stencil_and_ztest_span(ctx, span)) {