From 6ddffa010a86698543e2d0ecc07d1b93d8700e53 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 19 Dec 2019 02:13:32 -0300 Subject: vk_resource_manager: Implement VKFenceWatch move constructor This allows us to put VKFenceWatch inside a std::vector without storing it in heap. On move we have to signal the fences where the new protected resource is, adding some overhead. --- src/video_core/renderer_vulkan/vk_resource_manager.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/video_core/renderer_vulkan/vk_resource_manager.h') diff --git a/src/video_core/renderer_vulkan/vk_resource_manager.h b/src/video_core/renderer_vulkan/vk_resource_manager.h index 08ee86fa6..3a9683f95 100644 --- a/src/video_core/renderer_vulkan/vk_resource_manager.h +++ b/src/video_core/renderer_vulkan/vk_resource_manager.h @@ -65,6 +65,9 @@ public: /// Removes protection for a resource. void Unprotect(VKResource* resource); + /// Redirects one protected resource to a new address. + void RedirectProtection(VKResource* old_resource, VKResource* new_resource) noexcept; + /// Retreives the fence. operator vk::Fence() const { return *handle; @@ -97,8 +100,13 @@ private: class VKFenceWatch final : public VKResource { public: explicit VKFenceWatch(); + VKFenceWatch(VKFence& initial_fence); + VKFenceWatch(VKFenceWatch&&) noexcept; + VKFenceWatch(const VKFenceWatch&) = delete; ~VKFenceWatch() override; + VKFenceWatch& operator=(VKFenceWatch&&) noexcept; + /// Waits for the fence to be released. void Wait(); -- cgit v1.2.3