From 0b56ac82eb87cd12d84f61627c8236bd6e782a81 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 9 Aug 2022 07:44:10 -0400 Subject: [PATCH] zink: move zink_batch_resource_usage_set to be static inline this has to go in zink_resource.h to avoid infinite include dependency conflicts Reviewed-by: Samuel Pitoiset Part-of: --- src/gallium/drivers/zink/zink_batch.c | 21 --------------------- src/gallium/drivers/zink/zink_batch.h | 3 --- src/gallium/drivers/zink/zink_resource.h | 22 ++++++++++++++++++++++ 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c index ede5c23..db3f280 100644 --- a/src/gallium/drivers/zink/zink_batch.c +++ b/src/gallium/drivers/zink/zink_batch.c @@ -521,27 +521,6 @@ zink_end_batch(struct zink_context *ctx, struct zink_batch *batch) } void -zink_batch_resource_usage_set(struct zink_batch *batch, struct zink_resource *res, bool write) -{ - if (res->obj->dt) { - VkSemaphore acquire = zink_kopper_acquire_submit(zink_screen(batch->state->ctx->base.screen), res); - if (acquire) - util_dynarray_append(&batch->state->acquires, VkSemaphore, acquire); - } - if (write && !res->obj->is_buffer) { - if (!res->valid && res->fb_binds) - batch->state->ctx->rp_loadop_changed = true; - res->valid = true; - } - zink_resource_usage_set(res, batch->state, write); - /* multiple array entries are fine */ - if (!res->obj->coherent && res->obj->persistent_maps) - util_dynarray_append(&batch->state->persistent_resources, struct zink_resource_object*, res->obj); - - batch->has_work = true; -} - -void zink_batch_reference_resource_rw(struct zink_batch *batch, struct zink_resource *res, bool write) { /* if the resource already has usage of any sort set for this batch, */ diff --git a/src/gallium/drivers/zink/zink_batch.h b/src/gallium/drivers/zink/zink_batch.h index 337cc73..5e515ae 100644 --- a/src/gallium/drivers/zink/zink_batch.h +++ b/src/gallium/drivers/zink/zink_batch.h @@ -69,9 +69,6 @@ void zink_batch_add_wait_semaphore(struct zink_batch *batch, VkSemaphore sem); void -zink_batch_resource_usage_set(struct zink_batch *batch, struct zink_resource *res, bool write); - -void zink_batch_reference_resource_rw(struct zink_batch *batch, struct zink_resource *res, bool write); diff --git a/src/gallium/drivers/zink/zink_resource.h b/src/gallium/drivers/zink/zink_resource.h index f368a5d..cae8209 100644 --- a/src/gallium/drivers/zink/zink_resource.h +++ b/src/gallium/drivers/zink/zink_resource.h @@ -86,6 +86,7 @@ zink_is_swapchain(const struct zink_resource *res) #include "zink_batch.h" #include "zink_bo.h" +#include "zink_kopper.h" static inline bool zink_resource_usage_is_unflushed(const struct zink_resource *res) @@ -142,6 +143,27 @@ zink_resource_object_usage_unset(struct zink_resource_object *obj, struct zink_b return zink_bo_usage_unset(obj->bo, bs); } +static inline void +zink_batch_resource_usage_set(struct zink_batch *batch, struct zink_resource *res, bool write) +{ + if (res->obj->dt) { + VkSemaphore acquire = zink_kopper_acquire_submit(zink_screen(batch->state->ctx->base.screen), res); + if (acquire) + util_dynarray_append(&batch->state->acquires, VkSemaphore, acquire); + } + if (write && !res->obj->is_buffer) { + if (!res->valid && res->fb_binds) + batch->state->ctx->rp_loadop_changed = true; + res->valid = true; + } + zink_resource_usage_set(res, batch->state, write); + /* multiple array entries are fine */ + if (!res->obj->coherent && res->obj->persistent_maps) + util_dynarray_append(&batch->state->persistent_resources, struct zink_resource_object*, res->obj); + + batch->has_work = true; +} + #ifdef __cplusplus } #endif -- 2.7.4