summaryrefslogtreecommitdiff
path: root/src/video_core/control
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2022-01-01 22:03:37 +0100
committerGravatar Fernando Sahmkow2022-10-06 21:00:52 +0200
commitf350c3d74ea7880fc6d21f7f638b0d4a70a3246b (patch)
tree30927fa3c736f5b758a0a971a2d95114d8f8d5fa /src/video_core/control
parentTexture cache: Fix dangling references on multichannel. (diff)
downloadyuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar.gz
yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.tar.xz
yuzu-f350c3d74ea7880fc6d21f7f638b0d4a70a3246b.zip
Texture cache: Fix the remaining issues with memory mnagement and unmapping.
Diffstat (limited to 'src/video_core/control')
-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 @@
3#include <deque> 3#include <deque>
4#include <limits> 4#include <limits>
5#include <mutex> 5#include <mutex>
6#include <optional>
6#include <unordered_map> 7#include <unordered_map>
7 8
8#include "common/common_types.h" 9#include "common/common_types.h"
@@ -59,6 +60,15 @@ public:
59 return ref->second.gpu_memory; 60 return ref->second.gpu_memory;
60 } 61 }
61 62
63 std::optional<size_t> getStorageID(size_t id) const {
64 std::unique_lock<std::mutex> lk(config_mutex);
65 const auto ref = address_spaces.find(id);
66 if (ref == address_spaces.end()) {
67 return std::nullopt;
68 }
69 return ref->second.storage_id;
70 }
71
62protected: 72protected:
63 static constexpr size_t UNSET_CHANNEL{std::numeric_limits<size_t>::max()}; 73 static constexpr size_t UNSET_CHANNEL{std::numeric_limits<size_t>::max()};
64 74