freedreno/batch: fix crash in !reorder case

We aren't using the batch-cache if reorder==false.

Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
Rob Clark
2018-08-29 16:04:22 -04:00
parent 2c623e7071
commit c77e0948c7
@@ -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);