summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Edmundson <kde@davidedmundson.co.uk>2023-03-31 10:15:08 +0100
committerDavid Edmundson <davidedmundson@kde.org>2023-06-01 14:13:12 +0000
commit9b3a347d6cc3bbc40071f245344b7bff9e6c2d96 (patch)
tree00ebc3a9313056a53aa63246d6f5131c8cdb8afc /src
parent21b5b6ed67ff7bfcda40125708314618935355aa (diff)
Client: Guard our surface from being destroyed whilst rendering from Vulkan
Change-Id: Ibac173b769186b49251bad9b94c71b9ccea26a7e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandvulkaninstance.cpp20
-rw-r--r--src/client/qwaylandvulkaninstance_p.h3
2 files changed, 23 insertions, 0 deletions
diff --git a/src/client/qwaylandvulkaninstance.cpp b/src/client/qwaylandvulkaninstance.cpp
index 2f95ff307..be55130a4 100644
--- a/src/client/qwaylandvulkaninstance.cpp
+++ b/src/client/qwaylandvulkaninstance.cpp
@@ -101,6 +101,26 @@ void QWaylandVulkanInstance::presentAboutToBeQueued(QWindow *window)
w->handleUpdate();
}
+void QWaylandVulkanInstance::beginFrame(QWindow *window)
+{
+ auto *w = static_cast<QWaylandWindow *>(window->handle());
+ if (!w) {
+ qWarning() << "Attempted to call beginFrame() without a valid platform window";
+ return;
+ }
+ w->beginFrame();
+}
+
+void QWaylandVulkanInstance::endFrame(QWindow *window)
+{
+ auto *w = static_cast<QWaylandWindow *>(window->handle());
+ if (!w) {
+ qWarning() << "Attempted to call endFrame() without a valid platform window";
+ return;
+ }
+ w->endFrame();
+}
+
} // namespace QtWaylandClient
QT_END_NAMESPACE
diff --git a/src/client/qwaylandvulkaninstance_p.h b/src/client/qwaylandvulkaninstance_p.h
index abeca95db..7683ce566 100644
--- a/src/client/qwaylandvulkaninstance_p.h
+++ b/src/client/qwaylandvulkaninstance_p.h
@@ -42,6 +42,9 @@ public:
VkSurfaceKHR createSurface(QWaylandWindow *window);
+ void beginFrame(QWindow *window) override;
+ void endFrame(QWindow *window) override;
+
private:
QVulkanInstance *m_instance = nullptr;
PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR m_getPhysDevPresSupport = nullptr;