diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-02-24 08:19:04 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-02-24 08:19:04 +0100 |
commit | 281a8bf2595522a90cbb57e1739329da48c430f8 (patch) | |
tree | 794613c587c08eb77cbd721e1648fa04a1f016cc /src | |
parent | Merge pull request #2146 from ReinUsesLisp/vulkan-scheduler (diff) | |
download | yuzu-281a8bf2595522a90cbb57e1739329da48c430f8.tar yuzu-281a8bf2595522a90cbb57e1739329da48c430f8.tar.gz yuzu-281a8bf2595522a90cbb57e1739329da48c430f8.tar.bz2 yuzu-281a8bf2595522a90cbb57e1739329da48c430f8.tar.lz yuzu-281a8bf2595522a90cbb57e1739329da48c430f8.tar.xz yuzu-281a8bf2595522a90cbb57e1739329da48c430f8.tar.zst yuzu-281a8bf2595522a90cbb57e1739329da48c430f8.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_resource_manager.cpp | 12 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_resource_manager.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/video_core/renderer_vulkan/vk_resource_manager.cpp b/src/video_core/renderer_vulkan/vk_resource_manager.cpp index 1678463c7..a1e117443 100644 --- a/src/video_core/renderer_vulkan/vk_resource_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_resource_manager.cpp @@ -125,11 +125,12 @@ void VKFence::Protect(VKResource* resource) { protected_resources.push_back(resource); } -void VKFence::Unprotect(const VKResource* resource) { +void VKFence::Unprotect(VKResource* resource) { const auto it = std::find(protected_resources.begin(), protected_resources.end(), resource); - if (it != protected_resources.end()) { - protected_resources.erase(it); - } + ASSERT(it != protected_resources.end()); + + resource->OnFenceRemoval(this); + protected_resources.erase(it); } VKFenceWatch::VKFenceWatch() = default; @@ -141,12 +142,11 @@ VKFenceWatch::~VKFenceWatch() { } void VKFenceWatch::Wait() { - if (!fence) { + if (fence == nullptr) { return; } fence->Wait(); fence->Unprotect(this); - fence = nullptr; } void VKFenceWatch::Watch(VKFence& new_fence) { diff --git a/src/video_core/renderer_vulkan/vk_resource_manager.h b/src/video_core/renderer_vulkan/vk_resource_manager.h index 5018dfa44..5bfe4cead 100644 --- a/src/video_core/renderer_vulkan/vk_resource_manager.h +++ b/src/video_core/renderer_vulkan/vk_resource_manager.h @@ -63,7 +63,7 @@ public: void Protect(VKResource* resource); /// Removes protection for a resource. - void Unprotect(const VKResource* resource); + void Unprotect(VKResource* resource); /// Retreives the fence. operator vk::Fence() const { |