X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fswrast%2Fs_span.c;h=d36c8132f639066da3c3cabb92644a785aa43e23;hb=b57abd3bea29e95e5dee2524c3f1be4b26017c0f;hp=0e2793b47403fde0cc50484320a1d91d2e7afdb6;hpb=bf57eda0ecf1996bc2d188ef0b51a8f3ec993412;p=mesa.git diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 0e2793b4740..d36c8132f63 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -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.