diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-12-23 01:40:45 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-10-06 21:00:52 +0200 |
commit | 9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee (patch) | |
tree | b213e143366041f07ac9389e91801384f698b0d8 /src/video_core/control | |
parent | Refactor VideoCore to use AS sepparate from Channel. (diff) | |
download | yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.tar yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.tar.gz yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.tar.bz2 yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.tar.lz yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.tar.xz yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.tar.zst yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/control/channel_state_cache.h | 1 | ||||
-rw-r--r-- | src/video_core/control/channel_state_cache.inc | 17 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/video_core/control/channel_state_cache.h b/src/video_core/control/channel_state_cache.h index c51040c83..9b1d7362b 100644 --- a/src/video_core/control/channel_state_cache.h +++ b/src/video_core/control/channel_state_cache.h @@ -72,6 +72,7 @@ protected: std::deque<P> channel_storage; std::deque<size_t> free_channel_ids; std::unordered_map<s32, size_t> channel_map; + std::vector<size_t> active_channel_ids; struct AddresSpaceRef { size_t ref_count; size_t storage_id; diff --git a/src/video_core/control/channel_state_cache.inc b/src/video_core/control/channel_state_cache.inc index 185eabc35..d3ae758b2 100644 --- a/src/video_core/control/channel_state_cache.inc +++ b/src/video_core/control/channel_state_cache.inc @@ -1,3 +1,6 @@ + +#include <algorithm> + #include "video_core/control/channel_state.h" #include "video_core/control/channel_state_cache.h" #include "video_core/engines/kepler_compute.h" @@ -27,15 +30,16 @@ void ChannelSetupCaches<P>::CreateChannel(struct Tegra::Control::ChannelState& c if (current_channel_id != UNSET_CHANNEL) { channel_state = &channel_storage[current_channel_id]; } + active_channel_ids.push_back(new_id); auto as_it = address_spaces.find(channel.memory_manager->GetID()); if (as_it != address_spaces.end()) { - as_it->second.ref_count++; - return; + as_it->second.ref_count++; + return; } AddresSpaceRef new_gpu_mem_ref{ - .ref_count = 1, - .storage_id = address_spaces.size(), - .gpu_memory = channel.memory_manager.get(), + .ref_count = 1, + .storage_id = address_spaces.size(), + .gpu_memory = channel.memory_manager.get(), }; address_spaces.emplace(channel.memory_manager->GetID(), new_gpu_mem_ref); OnGPUASRegister(channel.memory_manager->GetID()); @@ -73,7 +77,8 @@ void ChannelSetupCaches<P>::EraseChannel(s32 id) { } else if (current_channel_id != UNSET_CHANNEL) { channel_state = &channel_storage[current_channel_id]; } + active_channel_ids.erase( + std::find(active_channel_ids.begin(), active_channel_ids.end(), this_id)); } - } // namespace VideoCommon |