only run shader on active fragments in the span
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 28 Feb 2006 15:48:43 +0000 (15:48 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 28 Feb 2006 15:48:43 +0000 (15:48 +0000)
src/mesa/swrast/s_arbshader.c

index e17e799100e3dc4000f111b533b47205189d2690..c915b97d6ecc10eb7c1fe0070e9bfc1f91949258 100644 (file)
@@ -46,6 +46,8 @@ void _swrast_exec_arbshader (GLcontext *ctx, struct sw_span *span)
 \r
        for (i = span->start; i < span->end; i++)\r
        {\r
+            /* only run shader on active fragments */\r
+            if (span->array->mask[i]) {\r
                GLfloat vec[4];\r
                GLuint j;\r
                GLboolean discard;\r
@@ -89,6 +91,7 @@ void _swrast_exec_arbshader (GLcontext *ctx, struct sw_span *span)
                        UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][BCOMP], vec[2]);\r
                        UNCLAMPED_FLOAT_TO_CHAN(span->array->rgba[i][ACOMP], vec[3]);\r
                }\r
+            }\r
        }\r
 }\r
 \r