summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorFeng Chen <vonchenplus@gmail.com>2021-12-03 05:31:07 +0100
committervonchenplus <vonchenplus@gmail.com>2021-12-04 17:06:14 +0100
commit5462485cc3835941713b835bce3b671b15d210b7 (patch)
treee054071cd06fd36a0ca03478e168cb866a057b15 /src/video_core
parentSupport multiple videos playing (diff)
downloadyuzu-5462485cc3835941713b835bce3b671b15d210b7.tar
yuzu-5462485cc3835941713b835bce3b671b15d210b7.tar.gz
yuzu-5462485cc3835941713b835bce3b671b15d210b7.tar.bz2
yuzu-5462485cc3835941713b835bce3b671b15d210b7.tar.lz
yuzu-5462485cc3835941713b835bce3b671b15d210b7.tar.xz
yuzu-5462485cc3835941713b835bce3b671b15d210b7.tar.zst
yuzu-5462485cc3835941713b835bce3b671b15d210b7.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/gpu.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 27a47954d..8788f5148 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -333,8 +333,8 @@ struct GPU::Impl {
return;
}
- if (cdma_pushers.find(id) == cdma_pushers.end()) {
- cdma_pushers[id] = std::make_unique<Tegra::CDmaPusher>(gpu);
+ if (!cdma_pushers.contains(id)) {
+ cdma_pushers.insert_or_assign(id, std::make_unique<Tegra::CDmaPusher>(gpu));
}
// SubmitCommandBuffer would make the nvdec operations async, this is not currently working
@@ -345,8 +345,9 @@ struct GPU::Impl {
/// Frees the CDMAPusher instance to free up resources
void ClearCdmaInstance(u32 id) {
- if (cdma_pushers.find(id) != cdma_pushers.end()) {
- cdma_pushers.erase(id);
+ const auto iter = cdma_pushers.find(id);
+ if (iter != cdma_pushers.end()) {
+ cdma_pushers.erase(iter);
}
}