Fix bogus span mask in s_atifragshader.c leading to trouble when the pixel was later...
authorRoland Scheidegger <rscheidegger@gmx.ch>
Fri, 3 Mar 2006 02:46:03 +0000 (02:46 +0000)
committerRoland Scheidegger <rscheidegger@gmx.ch>
Fri, 3 Mar 2006 02:46:03 +0000 (02:46 +0000)
src/mesa/swrast/s_atifragshader.c
src/mesa/swrast/s_span.c

index 36ada5fa304e2fb9e913cd4f33fa6fa8ead3d131..08640e146b59ff2afd54a5a26f59a33763685da4 100644 (file)
@@ -593,10 +593,11 @@ _swrast_exec_fragment_shader(GLcontext * ctx, struct sw_span *span)
       if (span->array->mask[i]) {
         init_machine(ctx, &ctx->ATIFragmentShader.Machine,
                      ctx->ATIFragmentShader.Current, span, i);
-
-        if (execute_shader(ctx, shader, ~0,
+        /* can't really happen... */
+        if (!execute_shader(ctx, shader, ~0,
                            &ctx->ATIFragmentShader.Machine, span, i)) {
            span->array->mask[i] = GL_FALSE;
+            span->writeAll = GL_FALSE;
         }
 
         {
index 0856b801ed2213ff53f6f65a9e4fe549595a9ee6..c4a725fa197dd3395ca3378b6d5d08540203fd0d 100644 (file)
@@ -1084,7 +1084,6 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
    const GLbitfield origArrayMask = span->arrayMask;
    const GLboolean deferredTexture = !(ctx->Color.AlphaEnabled ||
                                        ctx->FragmentProgram._Active ||
-                                       ctx->ATIFragmentShader._Enabled ||
                                        ctx->ShaderObjects.CurrentProgram);
 
    ASSERT(span->primitive == GL_POINT  ||  span->primitive == GL_LINE ||
@@ -1174,9 +1173,11 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
          _swrast_texture_span( ctx, span );
 
       /* Do the alpha test */
-      if (!_swrast_alpha_test(ctx, span)) {
-         span->arrayMask = origArrayMask;
-        return;
+      if (ctx->Color.AlphaEnabled) {
+         if (!_swrast_alpha_test(ctx, span)) {
+            span->arrayMask = origArrayMask;
+           return;
+        }
       }
    }