r600g: also check CB bindings for textures to depth flush.
authorDave Airlie <airlied@redhat.com>
Thu, 3 Feb 2011 23:06:02 +0000 (09:06 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 3 Feb 2011 23:09:44 +0000 (09:09 +1000)
This checks the color buffer bindings to make sure there is something
to flush.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_blit.c

index c11268c..1a19080 100644 (file)
@@ -136,6 +136,17 @@ void r600_flush_depth_textures(struct r600_pipe_context *rctx)
 
                r600_blit_uncompress_depth(&rctx->context, tex);
        }
+
+       /* also check CB here */
+       for (i = 0; i < rctx->framebuffer.nr_cbufs; i++) {
+               struct r600_resource_texture *tex;
+               tex = (struct r600_resource_texture *)rctx->framebuffer.cbufs[i]->texture;
+
+               if (!tex->depth)
+                       continue;
+
+               r600_blit_uncompress_depth(&rctx->context, tex);
+       }
 }
 
 static void r600_clear(struct pipe_context *ctx, unsigned buffers,