diff options
-rw-r--r-- | src/gallium/drivers/panfrost/pan_job.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 5722f4a1f31..b193ce6fa76 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -646,12 +646,18 @@ panfrost_batch_get_scratchpad(struct panfrost_batch *batch, thread_tls_alloc, core_count); - return panfrost_batch_create_bo(batch, size, + if (batch->scratchpad) { + assert(batch->scratchpad->size >= size); + } else { + batch->scratchpad = panfrost_batch_create_bo(batch, size, PAN_BO_INVISIBLE, PAN_BO_ACCESS_PRIVATE | PAN_BO_ACCESS_RW | PAN_BO_ACCESS_VERTEX_TILER | PAN_BO_ACCESS_FRAGMENT); + } + + return batch->scratchpad; } struct panfrost_bo * |