From 34dbf998aec9825d754dda5415c3b611d54619f7 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 7 Oct 2021 17:50:01 -0400 Subject: [PATCH] zink: switch remaining direct access of zink_resource_object::(reads|writes) to util I missed this one Reviewed-by: Adam Jackson Part-of: --- src/gallium/drivers/zink/zink_batch.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c index 582251d60a1..406ec8945cb 100644 --- a/src/gallium/drivers/zink/zink_batch.c +++ b/src/gallium/drivers/zink/zink_batch.c @@ -623,11 +623,12 @@ zink_batch_resource_usage_set(struct zink_batch *batch, struct zink_resource *re 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, we can skip hashing */ - if (!zink_batch_usage_matches(res->obj->reads, batch->state) && - !zink_batch_usage_matches(res->obj->writes, batch->state)) { + /* if the resource already has usage of any sort set for this batch, */ + if (!zink_resource_usage_matches(res, batch->state) || + /* or if it's bound somewhere */ + !zink_resource_has_binds(res)) + /* then it already has a batch ref and doesn't need one here */ zink_batch_reference_resource(batch, res); - } zink_batch_resource_usage_set(batch, res, write); }