OSDN Git Service

i965: Respect spec requirement for pixel shader computed depth with no zbuffer.
authorEric Anholt <eric@anholt.net>
Sun, 6 Sep 2009 22:46:17 +0000 (15:46 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 8 Sep 2009 21:28:23 +0000 (14:28 -0700)
src/mesa/drivers/dri/i965/brw_wm_state.c

index 39f8c6d..361f912 100644 (file)
@@ -107,6 +107,12 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key)
    /* as far as we can tell */
    key->computes_depth =
       (fp->Base.OutputsWritten & (1 << FRAG_RESULT_DEPTH)) != 0;
+   /* BRW_NEW_DEPTH_BUFFER
+    * Override for NULL depthbuffer case, required by the Pixel Shader Computed
+    * Depth field.
+    */
+   if (brw->state.depth_region == NULL)
+      key->computes_depth = 0;
 
    /* _NEW_COLOR */
    key->uses_kill = fp->UsesKill || ctx->Color.AlphaEnabled;
@@ -300,6 +306,7 @@ const struct brw_tracked_state brw_wm_unit = {
 
       .brw = (BRW_NEW_FRAGMENT_PROGRAM | 
              BRW_NEW_CURBE_OFFSETS |
+             BRW_NEW_DEPTH_BUFFER |
              BRW_NEW_NR_WM_SURFACES),
 
       .cache = (CACHE_NEW_WM_PROG |