Mesa (main): zink: switch remaining direct access of zink_resource_object::(reads|writes) to util
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Oct 8 03:44:09 UTC 2021
Module: Mesa
Branch: main
Commit: 34dbf998aec9825d754dda5415c3b611d54619f7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=34dbf998aec9825d754dda5415c3b611d54619f7
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Thu Oct 7 17:50:01 2021 -0400
zink: switch remaining direct access of zink_resource_object::(reads|writes) to util
I missed this one
Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13259>
---
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);
}
More information about the mesa-commit
mailing list