From 97891aa19765591ed9c85952e8eac53459167315 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 7 Jun 2019 16:27:44 +0200 Subject: [PATCH] Fix Vulkan yes OpenGL no builds The format conversion relies on the QOpenGLTexture header that has its body ifdefed out with -no-opengl. However, Qt, in a very forward looking manner, allows having Vulkan support even when OpenGL is disabled. Assuming that the format conversion will not be used in -no-opengl builds, put the entire function inside a #if QT_CONFIG(opengl). Change-Id: I772e12129729d69b81159669d239ea3945a42e5a Reviewed-by: Johan Helsing --- src/platformsupport/vkconvenience/qvkconvenience.cpp | 2 ++ src/platformsupport/vkconvenience/qvkconvenience_p.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/platformsupport/vkconvenience/qvkconvenience.cpp b/src/platformsupport/vkconvenience/qvkconvenience.cpp index 462cdc9e0d..acde1d1bda 100644 --- a/src/platformsupport/vkconvenience/qvkconvenience.cpp +++ b/src/platformsupport/vkconvenience/qvkconvenience.cpp @@ -51,6 +51,7 @@ QT_BEGIN_NAMESPACE \ingroup qpa */ +#if QT_CONFIG(opengl) VkFormat QVkConvenience::vkFormatFromGlFormat(uint glFormat) { using GlFormat = QOpenGLTexture::TextureFormat; @@ -211,5 +212,6 @@ VkFormat QVkConvenience::vkFormatFromGlFormat(uint glFormat) default: return VK_FORMAT_UNDEFINED; } } +#endif QT_END_NAMESPACE diff --git a/src/platformsupport/vkconvenience/qvkconvenience_p.h b/src/platformsupport/vkconvenience/qvkconvenience_p.h index 1dd1dfc4a7..580271b593 100644 --- a/src/platformsupport/vkconvenience/qvkconvenience_p.h +++ b/src/platformsupport/vkconvenience/qvkconvenience_p.h @@ -59,7 +59,9 @@ QT_BEGIN_NAMESPACE class QVkConvenience { public: +#if QT_CONFIG(opengl) static VkFormat vkFormatFromGlFormat(uint glFormat); +#endif }; QT_END_NAMESPACE