broadcom/vc5: Disable early Z test when the FS writes Z.
authorEric Anholt <eric@anholt.net>
Fri, 3 Nov 2017 01:45:07 +0000 (18:45 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 7 Nov 2017 17:40:25 +0000 (09:40 -0800)
Fixes piglit early-z.

src/gallium/drivers/vc5/vc5_emit.c

index c0b5d541978d6d98ecdc14dbaa0305bfbdec73c5..094d5482954f22cdbb949cc07ad0723fb30e1304 100644 (file)
@@ -287,7 +287,8 @@ vc5_emit_state(struct pipe_context *pctx)
                                 config.z_updates_enable =
                                         vc5->zsa->base.depth.writemask;
                                 config.early_z_enable =
-                                        vc5->zsa->early_z_enable;
+                                        (vc5->zsa->early_z_enable &&
+                                         !vc5->prog.fs->prog_data.fs->writes_z);
                                 config.depth_test_function =
                                         vc5->zsa->base.depth.func;
                         } else {