swrast: can't use deferred texture/shading if using KIL instruction
authorBrian Paul <brianp@vmware.com>
Mon, 31 Aug 2009 19:28:31 +0000 (13:28 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 31 Aug 2009 19:28:31 +0000 (13:28 -0600)
If the fragment program uses KIL, we have to execute it before z/stencil
testing.  Otherwise, deferred texture/shading lets us skip shading for
pixels that fail z/stencil testing.

src/mesa/swrast/s_context.c

index e7c2ace..abf0008 100644 (file)
@@ -220,6 +220,9 @@ _swrast_update_deferred_texture(GLcontext *ctx)
          /* Z comes from fragment program/shader */
          swrast->_DeferredTexture = GL_FALSE;
       }
+      else if (fprog && fprog->UsesKill) {
+         swrast->_DeferredTexture = GL_FALSE;
+      }
       else if (ctx->Query.CurrentOcclusionObject) {
          /* occlusion query depends on shader discard/kill results */
          swrast->_DeferredTexture = GL_FALSE;