r600g: flush the whole context when CS is full, not just hw_context
authorMarek Olšák <maraeo@gmail.com>
Thu, 10 Nov 2011 17:42:10 +0000 (18:42 +0100)
committerMarek Olšák <maraeo@gmail.com>
Thu, 10 Nov 2011 17:48:23 +0000 (18:48 +0100)
Because we disable render condition in r600_flush, but not in r600_context_flush.

src/gallium/drivers/r600/r600.h
src/gallium/drivers/r600/r600_hw_context.c
src/gallium/drivers/r600/r600_pipe.c

index 5bd808ace4d5afe4523075fa816d6d30663fda04..28c1ee15ce3b1db80427e301866d6faaa2f1b07b 100644 (file)
@@ -192,6 +192,9 @@ struct r600_context {
        struct r600_screen      *screen;
        struct radeon_winsys    *ws;
        struct radeon_winsys_cs *cs;
+       struct pipe_context     *pipe;
+
+       void (*flush)(void *pipe, unsigned flags);
 
        struct r600_range       *range;
        unsigned                nblocks;
index 3a0cde39462d1209e179462ba1bfa22e426b7925..905ea85c39941021242de11c319e73da5f6b7f3d 100644 (file)
@@ -956,7 +956,7 @@ void r600_need_cs_space(struct r600_context *ctx, unsigned num_dw,
 
        /* Flush if there's not enough space. */
        if (num_dw > RADEON_MAX_CMDBUF_DWORDS) {
-               r600_context_flush(ctx, RADEON_FLUSH_ASYNC);
+               ctx->flush(ctx->pipe, RADEON_FLUSH_ASYNC);
        }
 }
 
index dcfcd6624406ad510eaf76dc0bad95e222e3a57c..243de140789af620427e5177c1042d8eea74bcb6 100644 (file)
@@ -272,6 +272,8 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
                return NULL;
        }
 
+       rctx->ctx.pipe = &rctx->context;
+       rctx->ctx.flush = r600_flush_from_winsys;
        rctx->ws->cs_set_flush_callback(rctx->ctx.cs, r600_flush_from_winsys, rctx);
 
        util_slab_create(&rctx->pool_transfers,