diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-06-07 16:27:44 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-06-11 10:01:57 +0200 |
commit | 97891aa19765591ed9c85952e8eac53459167315 (patch) | |
tree | cede93afded15c03f846b517fcae392478b8d43d | |
parent | 3e75c2965c96fa014ab74121e84d623fd04a27f7 (diff) |
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 <johan.helsing@qt.io>
-rw-r--r-- | src/platformsupport/vkconvenience/qvkconvenience.cpp | 2 | ||||
-rw-r--r-- | src/platformsupport/vkconvenience/qvkconvenience_p.h | 2 |
2 files changed, 4 insertions, 0 deletions
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 |