From 542c44ffde46a8db95c611c5f44e8add11f6388a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= Date: Thu, 31 Aug 2023 11:47:48 -0400 Subject: [PATCH] panfrost: Add panfrost_batch_write_bo MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Needed when writing to a BO from a compute shader when the BO isn't assigned to a resource yet. Signed-off-by: Louis-Francis Ratté-Boulianne Part-of: --- src/gallium/drivers/panfrost/pan_job.c | 8 ++++++++ src/gallium/drivers/panfrost/pan_job.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index be9e675..ed8b404 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -351,6 +351,14 @@ panfrost_batch_add_bo(struct panfrost_batch *batch, struct panfrost_bo *bo, } void +panfrost_batch_write_bo(struct panfrost_batch *batch, struct panfrost_bo *bo, + enum pipe_shader_type stage) +{ + panfrost_batch_add_bo_old( + batch, bo, PAN_BO_ACCESS_WRITE | panfrost_access_for_stage(stage)); +} + +void panfrost_batch_read_rsrc(struct panfrost_batch *batch, struct panfrost_resource *rsrc, enum pipe_shader_type stage) diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h index b5120b0..f57b828 100644 --- a/src/gallium/drivers/panfrost/pan_job.h +++ b/src/gallium/drivers/panfrost/pan_job.h @@ -205,6 +205,10 @@ panfrost_get_fresh_batch_for_fbo(struct panfrost_context *ctx, void panfrost_batch_add_bo(struct panfrost_batch *batch, struct panfrost_bo *bo, enum pipe_shader_type stage); +void panfrost_batch_write_bo(struct panfrost_batch *batch, + struct panfrost_bo *bo, + enum pipe_shader_type stage); + void panfrost_batch_read_rsrc(struct panfrost_batch *batch, struct panfrost_resource *rsrc, enum pipe_shader_type stage); -- 2.7.4