Mesa (main): zink: collapse a conditional in zink_batch_resource_usage_set()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 27 00:05:29 UTC 2021


Module: Mesa
Branch: main
Commit: e5d6ce6e5ed3f9608a860d71cc40ea4efcac957d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e5d6ce6e5ed3f9608a860d71cc40ea4efcac957d

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Jul  7 09:33:16 2021 -0400

zink: collapse a conditional in zink_batch_resource_usage_set()

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12008>

---

 src/gallium/drivers/zink/zink_batch.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c
index 026f00fe210..9e132640da7 100644
--- a/src/gallium/drivers/zink/zink_batch.c
+++ b/src/gallium/drivers/zink/zink_batch.c
@@ -584,13 +584,9 @@ 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 (write) {
-      zink_batch_usage_set(&res->obj->writes, batch->state);
-      if (res->scanout_obj)
-         batch->state->scanout_flush = true;
-   } else {
-      zink_batch_usage_set(&res->obj->reads, batch->state);
-   }
+   zink_resource_usage_set(res, batch->state, write);
+   if (write && res->scanout_obj)
+      batch->state->scanout_flush = true;
    /* 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);



More information about the mesa-commit mailing list