Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
[mesa.git] / src / mesa / swrast / s_span.c
index 0e2793b47403fde0cc50484320a1d91d2e7afdb6..d36c8132f639066da3c3cabb92644a785aa43e23 100644 (file)
@@ -885,6 +885,9 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span)
       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;
@@ -901,7 +904,6 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span)
       }
    }
 
-#if FEATURE_ARB_occlusion_query
    if (ctx->Query.CurrentOcclusionObject) {
       /* update count of 'passed' fragments */
       struct gl_query_object *q = ctx->Query.CurrentOcclusionObject;
@@ -909,7 +911,6 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span)
       for (i = 0; i < span->end; i++)
          q->Result += span->array->mask[i];
    }
-#endif
 
    /* we have to wait until after occlusion to do this test */
    if (ctx->Color.IndexMask == 0) {
@@ -1355,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)) {
@@ -1373,7 +1378,6 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
       }
    }
 
-#if FEATURE_ARB_occlusion_query
    if (ctx->Query.CurrentOcclusionObject) {
       /* update count of 'passed' fragments */
       struct gl_query_object *q = ctx->Query.CurrentOcclusionObject;
@@ -1381,7 +1385,6 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
       for (i = 0; i < span->end; i++)
          q->Result += span->array->mask[i];
    }
-#endif
 
    /* We had to wait until now to check for glColorMask(0,0,0,0) because of
     * the occlusion test.