freedreno/batch: fix crash in !reorder case
authorRob Clark <robdclark@gmail.com>
Wed, 29 Aug 2018 20:04:22 +0000 (16:04 -0400)
committerRob Clark <robdclark@gmail.com>
Wed, 5 Sep 2018 17:38:43 +0000 (13:38 -0400)
We aren't using the batch-cache if reorder==false.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_batch.c

index dd4b1ca9e6412e9c4853eee18081b7415902fc8e..36b834f4013b1b7a32f853f3644f13c915b38eee 100644 (file)
@@ -352,8 +352,14 @@ fd_batch_flush(struct fd_batch *batch, bool sync, bool force)
 
        if (newbatch) {
                struct fd_context *ctx = batch->ctx;
-               struct fd_batch *new_batch =
-                       fd_batch_from_fb(&ctx->screen->batch_cache, ctx, &batch->framebuffer);
+               struct fd_batch *new_batch;
+
+               if (ctx->screen->reorder) {
+                       new_batch = fd_batch_from_fb(&ctx->screen->batch_cache,
+                                       ctx, &batch->framebuffer);
+               } else {
+                       new_batch = fd_batch_create(ctx, false);
+               }
 
                util_copy_framebuffer_state(&new_batch->framebuffer, &batch->framebuffer);