freedreno/batch: replace lrz_clear with prologue
[mesa.git] / src / gallium / drivers / freedreno / freedreno_batch.c
index 86e8b5b7834e038a6ceead8193a670fd8a03e051..1a93a8272c9ba48f53dc63b428af343ceb2d6bdb 100644 (file)
@@ -164,9 +164,9 @@ batch_fini(struct fd_batch *batch)
                debug_assert(!batch->gmem);
        }
 
-       if (batch->lrz_clear) {
-               fd_ringbuffer_del(batch->lrz_clear);
-               batch->lrz_clear = NULL;
+       if (batch->prologue) {
+               fd_ringbuffer_del(batch->prologue);
+               batch->prologue = NULL;
        }
 
        if (batch->epilogue) {
@@ -336,6 +336,15 @@ batch_flush(struct fd_batch *batch)
        fd_screen_unlock(batch->ctx->screen);
 }
 
+/* Get per-batch prologue */
+struct fd_ringbuffer *
+fd_batch_get_prologue(struct fd_batch *batch)
+{
+       if (!batch->prologue)
+               batch->prologue = alloc_ring(batch, 0x1000, 0);
+       return batch->prologue;
+}
+
 /* NOTE: could drop the last ref to batch
  *
  * @sync: synchronize with flush_queue, ensures batch is *actually* flushed