Mesa (staging/21.3): zink: only reset zink_resource::so_valid on buffer rebind
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Oct 26 17:27:15 UTC 2021
Module: Mesa
Branch: staging/21.3
Commit: 0868d3c91df25d849358284c0f7280e2ba555397
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0868d3c91df25d849358284c0f7280e2ba555397
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Fri Oct 22 14:32:40 2021 -0400
zink: only reset zink_resource::so_valid on buffer rebind
otherwise this is going to randomly modify some image properties
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13490>
(cherry picked from commit 1a68f2eb8f4818944d656b8d0f9102c576815800)
---
.pick_status.json | 2 +-
src/gallium/drivers/zink/zink_context.c | 9 +++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 92607830e6c..409354ec800 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -40,7 +40,7 @@
"description": "zink: only reset zink_resource::so_valid on buffer rebind",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 02edb2574f1..f1027ae8430 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -3919,12 +3919,13 @@ rebind_image(struct zink_context *ctx, struct zink_resource *res)
bool
zink_resource_rebind(struct zink_context *ctx, struct zink_resource *res)
{
- /* force counter buffer reset */
- res->so_valid = false;
if (!zink_resource_has_binds(res))
- return true;
- if (res->base.b.target == PIPE_BUFFER)
+ return 0;
+ if (res->base.b.target == PIPE_BUFFER) {
+ /* force counter buffer reset */
+ res->so_valid = false;
return rebind_buffer(ctx, res, 0, 0) == res->bind_count[0] + res->bind_count[1];
+ }
rebind_image(ctx, res);
return false;
}
More information about the mesa-commit
mailing list