r300g: add one more ZTOP disable bit.
authorDave Airlie <airlied@redhat.com>
Wed, 14 Oct 2009 08:05:14 +0000 (18:05 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 14 Oct 2009 08:05:14 +0000 (18:05 +1000)
Still missing the frag uses kill support, hopefully nha can point that out.

src/gallium/drivers/r300/r300_fs.h
src/gallium/drivers/r300/r300_state.c

index 967e9f697e9aac47b1c7fe93750a6f1756ccb8d8..04453274aa35c59b33a6c46e0fe281d663648c99 100644 (file)
@@ -48,4 +48,10 @@ struct r300_fragment_shader {
 void r300_translate_fragment_shader(struct r300_context* r300,
                                     struct r300_fragment_shader* fs);
 
+static inline boolean r300_fragment_shader_writes_depth(struct r300_fragment_shader *fs)
+{
+    if (!fs)
+       return FALSE;
+    return (fs->code.writes_depth) ? TRUE : FALSE;
+}
 #endif /* R300_FS_H */
index d8533ac168e3467fb924f49077ed65fdb40e1db5..95e2943baa5298d19be99c5211b6ecd0c045000e 100644 (file)
@@ -252,9 +252,11 @@ static void*
 
     dsa->z_buffer_top = R300_ZTOP_ENABLE;
     /* XXX TODO: add frag prog rules for ztop disable */
+    if (r300_fragment_shader_writes_depth(r300->fs))
+       dsa->z_buffer_top = R300_ZTOP_DISABLE;
     if (state->alpha.enabled && state->alpha.func != PIPE_FUNC_ALWAYS)
        dsa->z_buffer_top = R300_ZTOP_DISABLE;
-    if (!is_empty_list(&r300->query_list))
+    if (r300->query_current)
        dsa->z_buffer_top = R300_ZTOP_DISABLE;
 
     return (void*)dsa;