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>
This commit is contained in:
parent
5043973b14
commit
4cfd0da3d9
@ -101,6 +101,26 @@ void QWaylandVulkanInstance::presentAboutToBeQueued(QWindow *window)
|
|||||||
w->handleUpdate();
|
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
|
} // namespace QtWaylandClient
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -42,6 +42,9 @@ public:
|
|||||||
|
|
||||||
VkSurfaceKHR createSurface(QWaylandWindow *window);
|
VkSurfaceKHR createSurface(QWaylandWindow *window);
|
||||||
|
|
||||||
|
void beginFrame(QWindow *window) override;
|
||||||
|
void endFrame(QWindow *window) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVulkanInstance *m_instance = nullptr;
|
QVulkanInstance *m_instance = nullptr;
|
||||||
PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR m_getPhysDevPresSupport = nullptr;
|
PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR m_getPhysDevPresSupport = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user