Move it to batch initialization, to take it out of the clear/draw path.
This should make sense - as soon as the batch is created, we need to
hold the refference. Functionally there shouldn't be unused batches
floating around anyway.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6327>
* fragment jobs.
*/
struct panfrost_batch *batch = panfrost_get_fresh_batch_for_fbo(ctx);
-
- panfrost_batch_add_fbo_bos(batch);
panfrost_batch_clear(batch, buffers, color, depth, stencil);
}
return;
}
- /* Now that we have a guaranteed terminating path, find the job.
- * Assignment commented out to prevent unused warning */
+ /* Now that we have a guaranteed terminating path, find the job. */
struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
-
- panfrost_batch_add_fbo_bos(batch);
panfrost_batch_set_requirements(batch);
/* Take into account a negative bias */
pipe_reference(NULL, &fence->reference);
}
+static void
+panfrost_batch_add_fbo_bos(struct panfrost_batch *batch);
+
static struct panfrost_batch *
panfrost_create_batch(struct panfrost_context *ctx,
const struct pipe_framebuffer_state *key)
batch->pool = panfrost_create_pool(batch, pan_device(ctx->base.screen));
+ panfrost_batch_add_fbo_bos(batch);
+
return batch;
}
panfrost_batch_add_bo(batch, rsrc->separate_stencil->bo, flags);
}
-void panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
+static void
+panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
{
uint32_t flags = PAN_BO_ACCESS_SHARED | PAN_BO_ACCESS_WRITE |
PAN_BO_ACCESS_VERTEX_TILER |
panfrost_batch_add_bo(struct panfrost_batch *batch, struct panfrost_bo *bo,
uint32_t flags);
-void panfrost_batch_add_fbo_bos(struct panfrost_batch *batch);
-
struct panfrost_bo *
panfrost_batch_create_bo(struct panfrost_batch *batch, size_t size,
uint32_t create_flags, uint32_t access_flags);