diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 663992586..e055332fe 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -229,20 +229,10 @@ class RenderWidget : public QWidget { public: RenderWidget(GRenderWindow* parent) : QWidget(parent) { setMouseTracking(true); - } - - virtual ~RenderWidget() = default; - - virtual void Present() {} - - void paintEvent(QPaintEvent* event) override { - Present(); update(); } - std::pair GetSize() const { - return std::make_pair(width(), height()); - } + virtual ~RenderWidget() = default; }; #ifdef HAS_OPENGL @@ -262,7 +252,7 @@ public: context = std::move(context_); } - void Present() override { + void Present() { if (!isVisible()) { return; } @@ -278,6 +268,11 @@ public: glFinish(); } + void paintEvent(QPaintEvent* event) override { + Present(); + update(); + } + QPaintEngine* paintEngine() const override { return nullptr; } @@ -309,7 +304,7 @@ struct SoftwareRenderWidget : public RenderWidget { explicit SoftwareRenderWidget(GRenderWindow* parent, Core::System& system_) : RenderWidget(parent), system(system_) {} - void Present() override { + void Present() { if (!isVisible()) { return; } @@ -339,6 +334,11 @@ struct SoftwareRenderWidget : public RenderWidget { painter.end(); } + void paintEvent(QPaintEvent* event) override { + Present(); + update(); + } + QImage LoadFramebuffer(VideoCore::ScreenId screen_id) { const auto& renderer = static_cast(system.Renderer()); const auto& info = renderer.Screen(screen_id); diff --git a/src/video_core/renderer_vulkan/vk_present_window.cpp b/src/video_core/renderer_vulkan/vk_present_window.cpp index 785600d6e..5d4754526 100644 --- a/src/video_core/renderer_vulkan/vk_present_window.cpp +++ b/src/video_core/renderer_vulkan/vk_present_window.cpp @@ -330,7 +330,11 @@ void PresentWindow::NotifySurfaceChanged() { } void PresentWindow::CopyToSwapchain(Frame* frame) { - const auto recreate_swapchain = [&] { swapchain.Create(frame->width, frame->height, surface); }; + const auto recreate_swapchain = [&] { + std::scoped_lock submit_lock{scheduler.submit_mutex}; + graphics_queue.waitIdle(); + swapchain.Create(frame->width, frame->height, surface); + }; #ifdef ANDROID std::unique_lock lock{recreate_surface_mutex};