Mesa (staging/22.0): gallium/tc: warn if an app is incompatible with cpu_storage
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Apr 14 19:50:46 UTC 2022
Module: Mesa
Branch: staging/22.0
Commit: 3d6bc18e31add8c37b21c955024124654da1ff01
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3d6bc18e31add8c37b21c955024124654da1ff01
Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date: Mon Feb 21 20:14:02 2022 +0100
gallium/tc: warn if an app is incompatible with cpu_storage
Instead of silently ignoring unmap calls.
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15074>
(cherry picked from commit 52ceb9dcb6f161295c28d37fa17dfe06d838fcaa)
---
src/gallium/auxiliary/util/u_threaded_context.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c
index eeddd201950..3045af7e4c8 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -2458,6 +2458,13 @@ tc_buffer_unmap(struct pipe_context *_pipe, struct pipe_transfer *transfer)
0, tres->b.width0, tres->cpu_storage);
/* This shouldn't have been freed by buffer_subdata. */
assert(tres->cpu_storage);
+ } else {
+ static bool warned_once = false;
+ if (!warned_once) {
+ fprintf(stderr, "This application is incompatible with cpu_storage.\n");
+ fprintf(stderr, "Use tc_max_cpu_storage_size=0 to disable it and report this issue to Mesa.\n");
+ warned_once = true;
+ }
}
tc_drop_resource_reference(ttrans->staging);
More information about the mesa-commit
mailing list