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>
This commit is contained in:
Briar 2025-05-02 18:42:58 +00:00 committed by CamilleLaVey
parent cb8f449dca
commit 559eb0a488
6 changed files with 57 additions and 26 deletions

View file

@ -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;