aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/vulkan_common/vulkan_wrapper.h
diff options
context:
space:
mode:
authorBriar <205427297+icy-briar@users.noreply.github.com>2025-05-02 18:42:58 +0000
committerCamilleLaVey <camillelavey@noreply.localhost>2025-05-02 18:42:58 +0000
commit559eb0a488b651397802066878aebdbd65b42baf (patch)
tree49a8295dabe49f0419bc2508fcff6a622f1f30cb /src/video_core/vulkan_common/vulkan_wrapper.h
parentcb8f449dca521a5625d012d5e8ec4ea5b2138f83 (diff)
renderer_vulkan: Use raw surface handles and improve release logic (#75)
Should fix or at least lessen the crashes when leaving runtime emulation on both Android / PC Also, may have improved the time required to leave the game Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/75 Co-authored-by: Briar <205427297+icy-briar@users.noreply.github.com> Co-committed-by: Briar <205427297+icy-briar@users.noreply.github.com>
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_wrapper.h')
-rw-r--r--src/video_core/vulkan_common/vulkan_wrapper.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h
index 1bb8a47bdf..aa9fb8e17b 100644
--- a/src/video_core/vulkan_common/vulkan_wrapper.h
+++ b/src/video_core/vulkan_common/vulkan_wrapper.h
@@ -430,6 +430,15 @@ public:
return handle != nullptr;
}
+ /**
+ * Releases ownership of the managed handle.
+ * The caller is responsible for managing the lifetime of the returned handle.
+ * The Handle object becomes invalid after this call.
+ */
+ Type release() noexcept {
+ return std::exchange(handle, nullptr);
+ }
+
protected:
Type handle = nullptr;
OwnerType owner = nullptr;
@@ -501,6 +510,15 @@ public:
return handle != nullptr;
}
+ /**
+ * Releases ownership of the managed handle.
+ * The caller is responsible for managing the lifetime of the returned handle.
+ * The Handle object becomes invalid after this call.
+ */
+ Type release() noexcept {
+ return std::exchange(handle, nullptr);
+ }
+
protected:
Type handle = nullptr;
const Dispatch* dld = nullptr;