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>
This commit is contained in:
Laszlo Agocs 2019-06-07 16:27:44 +02:00
parent 3e75c2965c
commit 97891aa197
2 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -59,7 +59,9 @@ QT_BEGIN_NAMESPACE
class QVkConvenience
{
public:
#if QT_CONFIG(opengl)
static VkFormat vkFormatFromGlFormat(uint glFormat);
#endif
};
QT_END_NAMESPACE