mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 03:18:55 +02:00
[vk] fix crash introduced in 9a07bd0570 (#3685)
Fix for current crash on master. Just reverted only the necessary stuff so that PresentManager can hold a reference to khr and resist death upon application hold/restore. @Lizzie shall judge. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3685 Co-authored-by: xbzk <xbzk@eden-emu.dev> Co-committed-by: xbzk <xbzk@eden-emu.dev>
This commit is contained in:
parent
c062931c9b
commit
ddac8c8eb5
3 changed files with 6 additions and 6 deletions
|
|
@ -137,7 +137,7 @@ try
|
||||||
memory_allocator,
|
memory_allocator,
|
||||||
scheduler,
|
scheduler,
|
||||||
swapchain,
|
swapchain,
|
||||||
*surface)
|
surface)
|
||||||
, blit_swapchain(device_memory,
|
, blit_swapchain(device_memory,
|
||||||
device,
|
device,
|
||||||
memory_allocator,
|
memory_allocator,
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ PresentManager::PresentManager(const vk::Instance& instance_,
|
||||||
MemoryAllocator& memory_allocator_,
|
MemoryAllocator& memory_allocator_,
|
||||||
Scheduler& scheduler_,
|
Scheduler& scheduler_,
|
||||||
Swapchain& swapchain_,
|
Swapchain& swapchain_,
|
||||||
VkSurfaceKHR_T* surface_)
|
vk::SurfaceKHR& surface_)
|
||||||
: instance{instance_}
|
: instance{instance_}
|
||||||
, render_window{render_window_}
|
, render_window{render_window_}
|
||||||
, device{device_}
|
, device{device_}
|
||||||
|
|
@ -291,7 +291,7 @@ void PresentManager::PresentThread(std::stop_token token) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PresentManager::RecreateSwapchain(Frame* frame) {
|
void PresentManager::RecreateSwapchain(Frame* frame) {
|
||||||
swapchain.Create(surface, frame->width, frame->height); // Pass raw pointer
|
swapchain.Create(*surface, frame->width, frame->height); // Pass raw pointer
|
||||||
SetImageCount();
|
SetImageCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -310,7 +310,7 @@ void PresentManager::CopyToSwapchain(Frame* frame) {
|
||||||
// Recreate surface and swapchain if needed.
|
// Recreate surface and swapchain if needed.
|
||||||
if (requires_recreation) {
|
if (requires_recreation) {
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
surface = *CreateSurface(instance, render_window.GetWindowInfo()).address();
|
surface = CreateSurface(instance, render_window.GetWindowInfo());
|
||||||
#endif
|
#endif
|
||||||
RecreateSwapchain(frame);
|
RecreateSwapchain(frame);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ public:
|
||||||
MemoryAllocator& memory_allocator,
|
MemoryAllocator& memory_allocator,
|
||||||
Scheduler& scheduler,
|
Scheduler& scheduler,
|
||||||
Swapchain& swapchain,
|
Swapchain& swapchain,
|
||||||
VkSurfaceKHR_T* surface);
|
vk::SurfaceKHR& surface);
|
||||||
~PresentManager();
|
~PresentManager();
|
||||||
|
|
||||||
/// Returns the last used presentation frame
|
/// Returns the last used presentation frame
|
||||||
|
|
@ -78,7 +78,7 @@ private:
|
||||||
MemoryAllocator& memory_allocator;
|
MemoryAllocator& memory_allocator;
|
||||||
Scheduler& scheduler;
|
Scheduler& scheduler;
|
||||||
Swapchain& swapchain;
|
Swapchain& swapchain;
|
||||||
VkSurfaceKHR_T* surface;
|
vk::SurfaceKHR& surface;
|
||||||
vk::CommandPool cmdpool;
|
vk::CommandPool cmdpool;
|
||||||
std::vector<Frame> frames;
|
std::vector<Frame> frames;
|
||||||
boost::container::deque<Frame*> present_queue;
|
boost::container::deque<Frame*> present_queue;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue