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:
parent
3e75c2965c
commit
97891aa197
@ -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
|
||||
|
@ -59,7 +59,9 @@ QT_BEGIN_NAMESPACE
|
||||
class QVkConvenience
|
||||
{
|
||||
public:
|
||||
#if QT_CONFIG(opengl)
|
||||
static VkFormat vkFormatFromGlFormat(uint glFormat);
|
||||
#endif
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
Loading…
Reference in New Issue
Block a user