summaryrefslogtreecommitdiffstats
path: root/src/video_core/control/channel_state_cache.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2022-01-01 22:03:37 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2022-10-06 21:00:52 +0200
commitf350c3d74ea7880fc6d21f7f638b0d4a70a3246b (patch)
tree30927fa3c736f5b758a0a971a2d95114d8f8d5fa /src/video_core/control/channel_state_cache.h
parentTexture cache: Fix dangling references on multichannel. (diff)
downloadyuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar
yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar.gz
yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar.bz2
yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar.lz
yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar.xz
yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar.zst
yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/control/channel_state_cache.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/video_core/control/channel_state_cache.h b/src/video_core/control/channel_state_cache.h
index 9b1d7362b..31d80e8b7 100644
--- a/src/video_core/control/channel_state_cache.h
+++ b/src/video_core/control/channel_state_cache.h
@@ -3,6 +3,7 @@
#include <deque>
#include <limits>
#include <mutex>
+#include <optional>
#include <unordered_map>
#include "common/common_types.h"
@@ -59,6 +60,15 @@ public:
return ref->second.gpu_memory;
}
+ std::optional<size_t> getStorageID(size_t id) const {
+ std::unique_lock<std::mutex> lk(config_mutex);
+ const auto ref = address_spaces.find(id);
+ if (ref == address_spaces.end()) {
+ return std::nullopt;
+ }
+ return ref->second.storage_id;
+ }
+
protected:
static constexpr size_t UNSET_CHANNEL{std::numeric_limits<size_t>::max()};