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 e7c2ace32c7e86a1678654b8891eb061806a1a66..abf00085651b98658231befe1ee12ff909805923 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;