summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/vkconvenience
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-03-31 12:25:43 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-05-22 15:38:28 +0200
commit7a1650e34331f87bab5a9372087d2a1135f9f63a (patch)
treeef3c6949722b9521cd672d55fdad6d69353947b1 /src/platformsupport/vkconvenience
parent948134371eb3ea5a4b4237f4e1f1399d90562ded (diff)
Move QtVulkanSupport into QtGui and QtOpenGL
Task-number: QTBUG-83255 Change-Id: Ib021cecebda89fa2ab9332752124a8cec0a51a10 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/platformsupport/vkconvenience')
-rw-r--r--src/platformsupport/vkconvenience/.prev_CMakeLists.txt31
-rw-r--r--src/platformsupport/vkconvenience/CMakeLists.txt33
-rw-r--r--src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp405
-rw-r--r--src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h116
-rw-r--r--src/platformsupport/vkconvenience/qvkconvenience.cpp219
-rw-r--r--src/platformsupport/vkconvenience/qvkconvenience_p.h69
-rw-r--r--src/platformsupport/vkconvenience/vkconvenience.pro20
7 files changed, 0 insertions, 893 deletions
diff --git a/src/platformsupport/vkconvenience/.prev_CMakeLists.txt b/src/platformsupport/vkconvenience/.prev_CMakeLists.txt
deleted file mode 100644
index 6f17cfa306..0000000000
--- a/src/platformsupport/vkconvenience/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-# Generated from vkconvenience.pro.
-
-#####################################################################
-## VulkanSupport Module:
-#####################################################################
-
-qt_add_module(VulkanSupport
- STATIC
- INTERNAL_MODULE
- SOURCES
- qbasicvulkanplatforminstance.cpp qbasicvulkanplatforminstance_p.h
- qvkconvenience.cpp qvkconvenience_p.h
- DEFINES
- QT_NO_CAST_FROM_ASCII
- PUBLIC_LIBRARIES
- Qt::CorePrivate
- Qt::GuiPrivate
- PRECOMPILED_HEADER
- "../../corelib/global/qt_pch.h"
-)
-
-#### Keys ignored in scope 1:.:.:vkconvenience.pro:<TRUE>:
-# MODULE = "vulkan_support"
-
-## Scopes:
-#####################################################################
-
-qt_extend_target(VulkanSupport CONDITION QT_FEATURE_opengl
- PUBLIC_LIBRARIES
- Qt::OpenGL
-)
diff --git a/src/platformsupport/vkconvenience/CMakeLists.txt b/src/platformsupport/vkconvenience/CMakeLists.txt
deleted file mode 100644
index 6ec2574375..0000000000
--- a/src/platformsupport/vkconvenience/CMakeLists.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-# Generated from vkconvenience.pro.
-
-qt_find_package(Vulkan) # special case
-
-#####################################################################
-## VulkanSupport Module:
-#####################################################################
-
-qt_add_module(VulkanSupport
- STATIC
- INTERNAL_MODULE
- SOURCES
- qbasicvulkanplatforminstance.cpp qbasicvulkanplatforminstance_p.h
- qvkconvenience.cpp qvkconvenience_p.h
- DEFINES
- QT_NO_CAST_FROM_ASCII
- PUBLIC_LIBRARIES
- Qt::CorePrivate
- Qt::GuiPrivate
- PRECOMPILED_HEADER
- "../../corelib/global/qt_pch.h"
-)
-
-#### Keys ignored in scope 1:.:.:vkconvenience.pro:<TRUE>:
-# MODULE = "vulkan_support"
-
-## Scopes:
-#####################################################################
-
-qt_extend_target(VulkanSupport CONDITION QT_FEATURE_opengl
- PUBLIC_LIBRARIES
- Qt::OpenGL
-)
diff --git a/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp b/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp
deleted file mode 100644
index 6f6ba58319..0000000000
--- a/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp
+++ /dev/null
@@ -1,405 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qbasicvulkanplatforminstance_p.h"
-#include <QLibrary>
-#include <QCoreApplication>
-#include <QVector>
-#include <QLoggingCategory>
-
-QT_BEGIN_NAMESPACE
-
-Q_LOGGING_CATEGORY(lcPlatVk, "qt.vulkan")
-
-/*!
- \class QBasicPlatformVulkanInstance
- \brief A generic platform Vulkan instance implementation.
- \since 5.10
- \internal
- \ingroup qpa
-
- Implements QPlatformVulkanInstance, serving as a base for platform-specific
- implementations. The library loading and any WSI-specifics are excluded.
-
- Subclasses are expected to call init() from their constructor and
- initInstance() from their createOrAdoptInstance() implementation.
- */
-
-QBasicPlatformVulkanInstance::QBasicPlatformVulkanInstance()
- : m_vkInst(VK_NULL_HANDLE),
- m_vkGetInstanceProcAddr(nullptr),
- m_ownsVkInst(false),
- m_errorCode(VK_SUCCESS),
- m_debugCallback(0)
-{
-}
-
-QBasicPlatformVulkanInstance::~QBasicPlatformVulkanInstance()
-{
- if (!m_vkInst)
- return;
-
- if (m_debugCallback && m_vkDestroyDebugReportCallbackEXT)
- m_vkDestroyDebugReportCallbackEXT(m_vkInst, m_debugCallback, nullptr);
-
- if (m_ownsVkInst)
- m_vkDestroyInstance(m_vkInst, nullptr);
-}
-
-void QBasicPlatformVulkanInstance::loadVulkanLibrary(const QString &defaultLibraryName)
-{
- if (qEnvironmentVariableIsSet("QT_VULKAN_LIB"))
- m_vulkanLib.setFileName(QString::fromUtf8(qgetenv("QT_VULKAN_LIB")));
- else
- m_vulkanLib.setFileName(defaultLibraryName);
-
- if (!m_vulkanLib.load()) {
- qWarning("Failed to load %s: %s", qPrintable(m_vulkanLib.fileName()), qPrintable(m_vulkanLib.errorString()));
- return;
- }
-
- init(&m_vulkanLib);
-}
-
-void QBasicPlatformVulkanInstance::init(QLibrary *lib)
-{
- if (m_vkGetInstanceProcAddr)
- return;
-
- qCDebug(lcPlatVk, "Vulkan init (%s)", qPrintable(lib->fileName()));
-
- // While not strictly required with every implementation, try to follow the spec
- // and do not rely on core functions being exported.
- //
- // 1. dlsym vkGetInstanceProcAddr
- // 2. with a special null instance resolve vkCreateInstance and vkEnumerateInstance*
- // 3. all other core functions are resolved with the created instance
-
- m_vkGetInstanceProcAddr = reinterpret_cast<PFN_vkGetInstanceProcAddr>(lib->resolve("vkGetInstanceProcAddr"));
- if (!m_vkGetInstanceProcAddr) {
- qWarning("Failed to find vkGetInstanceProcAddr");
- return;
- }
-
- m_vkCreateInstance = reinterpret_cast<PFN_vkCreateInstance>(m_vkGetInstanceProcAddr(VK_NULL_HANDLE, "vkCreateInstance"));
- if (!m_vkCreateInstance) {
- qWarning("Failed to find vkCreateInstance");
- return;
- }
- m_vkEnumerateInstanceLayerProperties = reinterpret_cast<PFN_vkEnumerateInstanceLayerProperties>(
- m_vkGetInstanceProcAddr(VK_NULL_HANDLE, "vkEnumerateInstanceLayerProperties"));
- if (!m_vkEnumerateInstanceLayerProperties) {
- qWarning("Failed to find vkEnumerateInstanceLayerProperties");
- return;
- }
- m_vkEnumerateInstanceExtensionProperties = reinterpret_cast<PFN_vkEnumerateInstanceExtensionProperties>(
- m_vkGetInstanceProcAddr(VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties"));
- if (!m_vkEnumerateInstanceExtensionProperties) {
- qWarning("Failed to find vkEnumerateInstanceExtensionProperties");
- return;
- }
-
- uint32_t layerCount = 0;
- m_vkEnumerateInstanceLayerProperties(&layerCount, nullptr);
- if (layerCount) {
- QVector<VkLayerProperties> layerProps(layerCount);
- m_vkEnumerateInstanceLayerProperties(&layerCount, layerProps.data());
- m_supportedLayers.reserve(layerCount);
- for (const VkLayerProperties &p : qAsConst(layerProps)) {
- QVulkanLayer layer;
- layer.name = p.layerName;
- layer.version = p.implementationVersion;
- layer.specVersion = QVersionNumber(VK_VERSION_MAJOR(p.specVersion),
- VK_VERSION_MINOR(p.specVersion),
- VK_VERSION_PATCH(p.specVersion));
- layer.description = p.description;
- m_supportedLayers.append(layer);
- }
- }
- qCDebug(lcPlatVk) << "Supported Vulkan instance layers:" << m_supportedLayers;
-
- uint32_t extCount = 0;
- m_vkEnumerateInstanceExtensionProperties(nullptr, &extCount, nullptr);
- if (extCount) {
- QVector<VkExtensionProperties> extProps(extCount);
- m_vkEnumerateInstanceExtensionProperties(nullptr, &extCount, extProps.data());
- m_supportedExtensions.reserve(extCount);
- for (const VkExtensionProperties &p : qAsConst(extProps)) {
- QVulkanExtension ext;
- ext.name = p.extensionName;
- ext.version = p.specVersion;
- m_supportedExtensions.append(ext);
- }
- }
- qDebug(lcPlatVk) << "Supported Vulkan instance extensions:" << m_supportedExtensions;
-}
-
-QVulkanInfoVector<QVulkanLayer> QBasicPlatformVulkanInstance::supportedLayers() const
-{
- return m_supportedLayers;
-}
-
-QVulkanInfoVector<QVulkanExtension> QBasicPlatformVulkanInstance::supportedExtensions() const
-{
- return m_supportedExtensions;
-}
-
-void QBasicPlatformVulkanInstance::initInstance(QVulkanInstance *instance, const QByteArrayList &extraExts)
-{
- if (!m_vkGetInstanceProcAddr) {
- qWarning("initInstance: No Vulkan library available");
- return;
- }
-
- m_vkInst = instance->vkInstance(); // when non-null we are adopting an existing instance
-
- QVulkanInstance::Flags flags = instance->flags();
- m_enabledLayers = instance->layers();
- m_enabledExtensions = instance->extensions();
-
- if (!m_vkInst) {
- VkApplicationInfo appInfo;
- memset(&appInfo, 0, sizeof(appInfo));
- appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
- QByteArray appName = QCoreApplication::applicationName().toUtf8();
- appInfo.pApplicationName = appName.constData();
- const QVersionNumber apiVersion = instance->apiVersion();
- if (!apiVersion.isNull()) {
- appInfo.apiVersion = VK_MAKE_VERSION(apiVersion.majorVersion(),
- apiVersion.minorVersion(),
- apiVersion.microVersion());
- }
-
- if (!flags.testFlag(QVulkanInstance::NoDebugOutputRedirect))
- m_enabledExtensions.append("VK_EXT_debug_report");
-
- m_enabledExtensions.append("VK_KHR_surface");
-
- for (const QByteArray &ext : extraExts)
- m_enabledExtensions.append(ext);
-
- QByteArray envExts = qgetenv("QT_VULKAN_INSTANCE_EXTENSIONS");
- if (!envExts.isEmpty()) {
- QByteArrayList envExtList = envExts.split(';');
- for (auto ext : m_enabledExtensions)
- envExtList.removeAll(ext);
- m_enabledExtensions.append(envExtList);
- }
-
- QByteArray envLayers = qgetenv("QT_VULKAN_INSTANCE_LAYERS");
- if (!envLayers.isEmpty()) {
- QByteArrayList envLayerList = envLayers.split(';');
- for (auto ext : m_enabledLayers)
- envLayerList.removeAll(ext);
- m_enabledLayers.append(envLayerList);
- }
-
- // No clever stuff with QSet and friends: the order for layers matters
- // and the user-provided order must be kept.
- for (int i = 0; i < m_enabledLayers.count(); ++i) {
- const QByteArray &layerName(m_enabledLayers[i]);
- if (!m_supportedLayers.contains(layerName))
- m_enabledLayers.removeAt(i--);
- }
- qDebug(lcPlatVk) << "Enabling Vulkan instance layers:" << m_enabledLayers;
- for (int i = 0; i < m_enabledExtensions.count(); ++i) {
- const QByteArray &extName(m_enabledExtensions[i]);
- if (!m_supportedExtensions.contains(extName))
- m_enabledExtensions.removeAt(i--);
- }
- qDebug(lcPlatVk) << "Enabling Vulkan instance extensions:" << m_enabledExtensions;
-
- VkInstanceCreateInfo instInfo;
- memset(&instInfo, 0, sizeof(instInfo));
- instInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
- instInfo.pApplicationInfo = &appInfo;
-
- QVector<const char *> layerNameVec;
- for (const QByteArray &ba : qAsConst(m_enabledLayers))
- layerNameVec.append(ba.constData());
- if (!layerNameVec.isEmpty()) {
- instInfo.enabledLayerCount = layerNameVec.count();
- instInfo.ppEnabledLayerNames = layerNameVec.constData();
- }
-
- QVector<const char *> extNameVec;
- for (const QByteArray &ba : qAsConst(m_enabledExtensions))
- extNameVec.append(ba.constData());
- if (!extNameVec.isEmpty()) {
- instInfo.enabledExtensionCount = extNameVec.count();
- instInfo.ppEnabledExtensionNames = extNameVec.constData();
- }
-
- m_errorCode = m_vkCreateInstance(&instInfo, nullptr, &m_vkInst);
- if (m_errorCode != VK_SUCCESS || !m_vkInst) {
- qWarning("Failed to create Vulkan instance: %d", m_errorCode);
- return;
- }
-
- m_vkDestroyInstance = reinterpret_cast<PFN_vkDestroyInstance>(m_vkGetInstanceProcAddr(m_vkInst, "vkDestroyInstance"));
- if (!m_vkDestroyInstance) {
- qWarning("Failed to find vkDestroyInstance");
- m_vkInst = VK_NULL_HANDLE;
- return;
- }
-
- m_ownsVkInst = true;
- }
-
- m_getPhysDevSurfaceSupport = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceSupportKHR>(
- m_vkGetInstanceProcAddr(m_vkInst, "vkGetPhysicalDeviceSurfaceSupportKHR"));
- if (!m_getPhysDevSurfaceSupport)
- qWarning("Failed to find vkGetPhysicalDeviceSurfaceSupportKHR");
-
- m_destroySurface = reinterpret_cast<PFN_vkDestroySurfaceKHR>(
- m_vkGetInstanceProcAddr(m_vkInst, "vkDestroySurfaceKHR"));
- if (!m_destroySurface)
- qWarning("Failed to find vkDestroySurfaceKHR");
-
- if (!flags.testFlag(QVulkanInstance::NoDebugOutputRedirect))
- setupDebugOutput();
-}
-
-bool QBasicPlatformVulkanInstance::isValid() const
-{
- return m_vkInst != VK_NULL_HANDLE;
-}
-
-VkResult QBasicPlatformVulkanInstance::errorCode() const
-{
- return m_errorCode;
-}
-
-VkInstance QBasicPlatformVulkanInstance::vkInstance() const
-{
- return m_vkInst;
-}
-
-QByteArrayList QBasicPlatformVulkanInstance::enabledLayers() const
-{
- return m_enabledLayers;
-}
-
-QByteArrayList QBasicPlatformVulkanInstance::enabledExtensions() const
-{
- return m_enabledExtensions;
-}
-
-PFN_vkVoidFunction QBasicPlatformVulkanInstance::getInstanceProcAddr(const char *name)
-{
- if (!name)
- return nullptr;
-
- const bool needsNullInstance = !strcmp(name, "vkEnumerateInstanceLayerProperties")
- || !strcmp(name, "vkEnumerateInstanceExtensionProperties");
-
- return m_vkGetInstanceProcAddr(needsNullInstance ? 0 : m_vkInst, name);
-}
-
-bool QBasicPlatformVulkanInstance::supportsPresent(VkPhysicalDevice physicalDevice,
- uint32_t queueFamilyIndex,
- QWindow *window)
-{
- if (!m_getPhysDevSurfaceSupport)
- return true;
-
- VkSurfaceKHR surface = QVulkanInstance::surfaceForWindow(window);
- VkBool32 supported = false;
- m_getPhysDevSurfaceSupport(physicalDevice, queueFamilyIndex, surface, &supported);
-
- return supported;
-}
-
-void QBasicPlatformVulkanInstance::setDebugFilters(const QVector<QVulkanInstance::DebugFilter> &filters)
-{
- m_debugFilters = filters;
-}
-
-void QBasicPlatformVulkanInstance::destroySurface(VkSurfaceKHR surface) const
-{
- if (m_destroySurface && surface)
- m_destroySurface(m_vkInst, surface, nullptr);
-}
-
-static VKAPI_ATTR VkBool32 VKAPI_CALL defaultDebugCallbackFunc(VkDebugReportFlagsEXT flags,
- VkDebugReportObjectTypeEXT objectType,
- uint64_t object,
- size_t location,
- int32_t messageCode,
- const char *pLayerPrefix,
- const char *pMessage,
- void *pUserData)
-{
- QBasicPlatformVulkanInstance *self = static_cast<QBasicPlatformVulkanInstance *>(pUserData);
- for (QVulkanInstance::DebugFilter filter : *self->debugFilters()) {
- if (filter(flags, objectType, object, location, messageCode, pLayerPrefix, pMessage))
- return VK_FALSE;
- }
-
- // not categorized, just route to plain old qDebug
- qDebug("vkDebug: %s: %d: %s", pLayerPrefix, messageCode, pMessage);
-
- return VK_FALSE;
-}
-
-void QBasicPlatformVulkanInstance::setupDebugOutput()
-{
- if (!m_enabledExtensions.contains("VK_EXT_debug_report"))
- return;
-
- PFN_vkCreateDebugReportCallbackEXT createDebugReportCallback = reinterpret_cast<PFN_vkCreateDebugReportCallbackEXT>(
- m_vkGetInstanceProcAddr(m_vkInst, "vkCreateDebugReportCallbackEXT"));
- m_vkDestroyDebugReportCallbackEXT = reinterpret_cast<PFN_vkDestroyDebugReportCallbackEXT>(
- m_vkGetInstanceProcAddr(m_vkInst, "vkDestroyDebugReportCallbackEXT"));
-
- VkDebugReportCallbackCreateInfoEXT dbgCallbackInfo;
- memset(&dbgCallbackInfo, 0, sizeof(dbgCallbackInfo));
- dbgCallbackInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
- dbgCallbackInfo.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT
- | VK_DEBUG_REPORT_WARNING_BIT_EXT
- | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT;
- dbgCallbackInfo.pfnCallback = defaultDebugCallbackFunc;
- dbgCallbackInfo.pUserData = this;
-
- VkResult err = createDebugReportCallback(m_vkInst, &dbgCallbackInfo, nullptr, &m_debugCallback);
- if (err != VK_SUCCESS)
- qWarning("Failed to create debug report callback: %d", err);
-}
-
-QT_END_NAMESPACE
diff --git a/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h b/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h
deleted file mode 100644
index e59d9219fb..0000000000
--- a/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QBASICVULKANPLATFORMINSTANCE_P_H
-#define QBASICVULKANPLATFORMINSTANCE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/QLibrary>
-#include <qpa/qplatformvulkaninstance.h>
-
-QT_BEGIN_NAMESPACE
-
-class QLibrary;
-
-class QBasicPlatformVulkanInstance : public QPlatformVulkanInstance
-{
-public:
- QBasicPlatformVulkanInstance();
- ~QBasicPlatformVulkanInstance();
-
- QVulkanInfoVector<QVulkanLayer> supportedLayers() const override;
- QVulkanInfoVector<QVulkanExtension> supportedExtensions() const override;
- bool isValid() const override;
- VkResult errorCode() const override;
- VkInstance vkInstance() const override;
- QByteArrayList enabledLayers() const override;
- QByteArrayList enabledExtensions() const override;
- PFN_vkVoidFunction getInstanceProcAddr(const char *name) override;
- bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override;
- void setDebugFilters(const QVector<QVulkanInstance::DebugFilter> &filters) override;
-
- void destroySurface(VkSurfaceKHR surface) const;
- const QVector<QVulkanInstance::DebugFilter> *debugFilters() const { return &m_debugFilters; }
-
-protected:
- void loadVulkanLibrary(const QString &defaultLibraryName);
- void init(QLibrary *lib);
- void initInstance(QVulkanInstance *instance, const QByteArrayList &extraExts);
-
- VkInstance m_vkInst;
- PFN_vkGetInstanceProcAddr m_vkGetInstanceProcAddr;
- PFN_vkGetPhysicalDeviceSurfaceSupportKHR m_getPhysDevSurfaceSupport;
- PFN_vkDestroySurfaceKHR m_destroySurface;
-
-private:
- void setupDebugOutput();
-
- QLibrary m_vulkanLib;
-
- bool m_ownsVkInst;
- VkResult m_errorCode;
- QVulkanInfoVector<QVulkanLayer> m_supportedLayers;
- QVulkanInfoVector<QVulkanExtension> m_supportedExtensions;
- QByteArrayList m_enabledLayers;
- QByteArrayList m_enabledExtensions;
-
- PFN_vkCreateInstance m_vkCreateInstance;
- PFN_vkEnumerateInstanceLayerProperties m_vkEnumerateInstanceLayerProperties;
- PFN_vkEnumerateInstanceExtensionProperties m_vkEnumerateInstanceExtensionProperties;
-
- PFN_vkDestroyInstance m_vkDestroyInstance;
-
- VkDebugReportCallbackEXT m_debugCallback;
- PFN_vkDestroyDebugReportCallbackEXT m_vkDestroyDebugReportCallbackEXT;
- QVector<QVulkanInstance::DebugFilter> m_debugFilters;
-};
-
-QT_END_NAMESPACE
-
-#endif // QBASICVULKANPLATFORMINSTANCE_P_H
diff --git a/src/platformsupport/vkconvenience/qvkconvenience.cpp b/src/platformsupport/vkconvenience/qvkconvenience.cpp
deleted file mode 100644
index 59de335333..0000000000
--- a/src/platformsupport/vkconvenience/qvkconvenience.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qvkconvenience_p.h"
-
-#if QT_CONFIG(opengl)
-#include <QtOpenGL/QOpenGLTexture>
-#endif
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QVkConvenience
- \brief A collection of static helper functions for Vulkan support
- \since 5.14
- \internal
- \ingroup qpa
- */
-
-#if QT_CONFIG(opengl)
-VkFormat QVkConvenience::vkFormatFromGlFormat(uint glFormat)
-{
- using GlFormat = QOpenGLTexture::TextureFormat;
- switch (glFormat) {
- case GlFormat::NoFormat: return VK_FORMAT_UNDEFINED; // GL_NONE
-
- // Unsigned normalized formats
- case GlFormat::R8_UNorm: return VK_FORMAT_R8_UNORM; // GL_R8
- case GlFormat::RG8_UNorm: return VK_FORMAT_R8G8_UNORM; // GL_RG8
- case GlFormat::RGB8_UNorm: return VK_FORMAT_R8G8B8_UNORM; // GL_RGB8
- case GlFormat::RGBA8_UNorm: return VK_FORMAT_R8G8B8A8_UNORM; // GL_RGBA8
-
- case GlFormat::R16_UNorm: return VK_FORMAT_R16_UNORM; // GL_R16
- case GlFormat::RG16_UNorm: return VK_FORMAT_R16G16_UNORM; // GL_RG16
- case GlFormat::RGB16_UNorm: return VK_FORMAT_R16G16B16_UNORM; // GL_RGB16
- case GlFormat::RGBA16_UNorm: return VK_FORMAT_R16G16B16A16_UNORM; // GL_RGBA16
-
- // Signed normalized formats
- case GlFormat::R8_SNorm: return VK_FORMAT_R8_SNORM; // GL_R8_SNORM
- case GlFormat::RG8_SNorm: return VK_FORMAT_R8G8_SNORM; // GL_RG8_SNORM
- case GlFormat::RGB8_SNorm: return VK_FORMAT_R8G8B8_SNORM; // GL_RGB8_SNORM
- case GlFormat::RGBA8_SNorm: return VK_FORMAT_R8G8B8A8_SNORM; // GL_RGBA8_SNORM
-
- case GlFormat::R16_SNorm: return VK_FORMAT_R16_SNORM; // GL_R16_SNORM
- case GlFormat::RG16_SNorm: return VK_FORMAT_R16G16_SNORM; // GL_RG16_SNORM
- case GlFormat::RGB16_SNorm: return VK_FORMAT_R16G16B16_SNORM; // GL_RGB16_SNORM
- case GlFormat::RGBA16_SNorm: return VK_FORMAT_R16G16B16A16_SNORM; // GL_RGBA16_SNORM
-
- // Unsigned integer formats
- case GlFormat::R8U: return VK_FORMAT_R8_UINT; // GL_R8UI
- case GlFormat::RG8U: return VK_FORMAT_R8G8_UINT; // GL_RG8UI
- case GlFormat::RGB8U: return VK_FORMAT_R8G8B8_UINT; // GL_RGB8UI
- case GlFormat::RGBA8U: return VK_FORMAT_R8G8B8A8_UINT; // GL_RGBA8UI
-
- case GlFormat::R16U: return VK_FORMAT_R16_UINT; // GL_R16UI
- case GlFormat::RG16U: return VK_FORMAT_R16G16_UINT; // GL_RG16UI
- case GlFormat::RGB16U: return VK_FORMAT_R16G16B16_UINT; // GL_RGB16UI
- case GlFormat::RGBA16U: return VK_FORMAT_R16G16B16A16_UINT; // GL_RGBA16UI
-
- case GlFormat::R32U: return VK_FORMAT_R32_UINT; // GL_R32UI
- case GlFormat::RG32U: return VK_FORMAT_R32G32_UINT; // GL_RG32UI
- case GlFormat::RGB32U: return VK_FORMAT_R32G32B32_UINT; // GL_RGB32UI
- case GlFormat::RGBA32U: return VK_FORMAT_R32G32B32A32_UINT; // GL_RGBA32UI
-
- // Signed integer formats
- case GlFormat::R8I: return VK_FORMAT_R8_SINT; // GL_R8I
- case GlFormat::RG8I: return VK_FORMAT_R8G8_SINT; // GL_RG8I
- case GlFormat::RGB8I: return VK_FORMAT_R8G8B8_SINT; // GL_RGB8I
- case GlFormat::RGBA8I: return VK_FORMAT_R8G8B8A8_SINT; // GL_RGBA8I
-
- case GlFormat::R16I: return VK_FORMAT_R16_SINT; // GL_R16I
- case GlFormat::RG16I: return VK_FORMAT_R16G16_SINT; // GL_RG16I
- case GlFormat::RGB16I: return VK_FORMAT_R16G16B16_SINT; // GL_RGB16I
- case GlFormat::RGBA16I: return VK_FORMAT_R16G16B16A16_SINT; // GL_RGBA16I
-
- case GlFormat::R32I: return VK_FORMAT_R32_SINT; // GL_R32I
- case GlFormat::RG32I: return VK_FORMAT_R32G32_SINT; // GL_RG32I
- case GlFormat::RGB32I: return VK_FORMAT_R32G32B32_SINT; // GL_RGB32I
- case GlFormat::RGBA32I: return VK_FORMAT_R32G32B32A32_SINT; // GL_RGBA32I
-
- // Floating point formats
- case GlFormat::R16F: return VK_FORMAT_R16_SFLOAT; // GL_R16F
- case GlFormat::RG16F: return VK_FORMAT_R16G16_SFLOAT; // GL_RG16F
- case GlFormat::RGB16F: return VK_FORMAT_R16G16B16_SFLOAT; // GL_RGB16F
- case GlFormat::RGBA16F: return VK_FORMAT_R16G16B16A16_SFLOAT; // GL_RGBA16F
-
- case GlFormat::R32F: return VK_FORMAT_R32_SFLOAT; // GL_R32F
- case GlFormat::RG32F: return VK_FORMAT_R32G32_SFLOAT; // GL_RG32F
- case GlFormat::RGB32F: return VK_FORMAT_R32G32B32_SFLOAT; // GL_RGB32F
- case GlFormat::RGBA32F: return VK_FORMAT_R32G32B32A32_SFLOAT; // GL_RGBA32F
-
- // Packed formats
- case GlFormat::RGB9E5: return VK_FORMAT_E5B9G9R9_UFLOAT_PACK32; // GL_RGB9_E5
- case GlFormat::RG11B10F: return VK_FORMAT_B10G11R11_UFLOAT_PACK32; // GL_R11F_G11F_B10F
-// case GlFormat::RG3B2: return VK_FORMAT_R3_G3_B2; // GL_R3_G3_B2
- case GlFormat::R5G6B5: return VK_FORMAT_R5G6B5_UNORM_PACK16; // GL_RGB565
- case GlFormat::RGB5A1: return VK_FORMAT_R5G5B5A1_UNORM_PACK16; // GL_RGB5_A1
- case GlFormat::RGBA4: return VK_FORMAT_R4G4B4A4_UNORM_PACK16; // GL_RGBA4
- case GlFormat::RGB10A2: return VK_FORMAT_A2R10G10B10_UINT_PACK32; // GL_RGB10_A2UI
-
- // Depth formats
-// case Format::D16: return VK_FORMAT_DEPTH_COMPONENT16; // GL_DEPTH_COMPONENT16
-// case Format::D24: return VK_FORMAT_DEPTH_COMPONENT24; // GL_DEPTH_COMPONENT24
-// case Format::D24S8: return VK_FORMAT_DEPTH24_STENCIL8; // GL_DEPTH24_STENCIL8
-// case Format::D32: return VK_FORMAT_DEPTH_COMPONENT32; // GL_DEPTH_COMPONENT32
-// case Format::D32F: return VK_FORMAT_DEPTH_COMPONENT32F; // GL_DEPTH_COMPONENT32F
-// case Format::D32FS8X24: return VK_FORMAT_DEPTH32F_STENCIL8; // GL_DEPTH32F_STENCIL8
-// case Format::S8: return VK_FORMAT_STENCIL_INDEX8; // GL_STENCIL_INDEX8
-
- // Compressed formats
- case GlFormat::RGB_DXT1: return VK_FORMAT_BC1_RGB_UNORM_BLOCK; // GL_COMPRESSED_RGB_S3TC_DXT1_EXT
- case GlFormat::RGBA_DXT1: return VK_FORMAT_BC1_RGBA_UNORM_BLOCK; // GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
- case GlFormat::RGBA_DXT3: return VK_FORMAT_BC2_UNORM_BLOCK; // GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
- case GlFormat::RGBA_DXT5: return VK_FORMAT_BC3_UNORM_BLOCK; // GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
- case GlFormat::R_ATI1N_UNorm: return VK_FORMAT_BC4_UNORM_BLOCK; // GL_COMPRESSED_RED_RGTC1
- case GlFormat::R_ATI1N_SNorm: return VK_FORMAT_BC4_SNORM_BLOCK; // GL_COMPRESSED_SIGNED_RED_RGTC1
- case GlFormat::RG_ATI2N_UNorm: return VK_FORMAT_BC5_UNORM_BLOCK; // GL_COMPRESSED_RG_RGTC2
- case GlFormat::RG_ATI2N_SNorm: return VK_FORMAT_BC5_SNORM_BLOCK; // GL_COMPRESSED_SIGNED_RG_RGTC2
- case GlFormat::RGB_BP_UNSIGNED_FLOAT: return VK_FORMAT_BC6H_UFLOAT_BLOCK; // GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB
- case GlFormat::RGB_BP_SIGNED_FLOAT: return VK_FORMAT_BC6H_SFLOAT_BLOCK; // GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB
- case GlFormat::RGB_BP_UNorm: return VK_FORMAT_BC7_UNORM_BLOCK; // GL_COMPRESSED_RGBA_BPTC_UNORM_ARB
- case GlFormat::R11_EAC_UNorm: return VK_FORMAT_EAC_R11_UNORM_BLOCK; // GL_COMPRESSED_R11_EAC
- case GlFormat::R11_EAC_SNorm: return VK_FORMAT_EAC_R11_SNORM_BLOCK; // GL_COMPRESSED_SIGNED_R11_EAC
- case GlFormat::RG11_EAC_UNorm: return VK_FORMAT_EAC_R11G11_UNORM_BLOCK; // GL_COMPRESSED_RG11_EAC
- case GlFormat::RG11_EAC_SNorm: return VK_FORMAT_EAC_R11G11_SNORM_BLOCK; // GL_COMPRESSED_SIGNED_RG11_EAC
- case GlFormat::RGB8_ETC2: return VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK; // GL_COMPRESSED_RGB8_ETC2
- case GlFormat::SRGB8_ETC2: return VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ETC2
- case GlFormat::RGB8_PunchThrough_Alpha1_ETC2: return VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK; // GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
- case GlFormat::SRGB8_PunchThrough_Alpha1_ETC2: return VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
- case GlFormat::RGBA8_ETC2_EAC: return VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK; // GL_COMPRESSED_RGBA8_ETC2_EAC
- case GlFormat::SRGB8_Alpha8_ETC2_EAC: return VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
-// case GlFormat::RGB8_ETC1: return VK_FORMAT_ETC1_RGB8_OES; // GL_ETC1_RGB8_OES
- case GlFormat::RGBA_ASTC_4x4: return VK_FORMAT_ASTC_4x4_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_4x4_KHR
- case GlFormat::RGBA_ASTC_5x4: return VK_FORMAT_ASTC_5x4_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_5x4_KHR
- case GlFormat::RGBA_ASTC_5x5: return VK_FORMAT_ASTC_5x5_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_5x5_KHR
- case GlFormat::RGBA_ASTC_6x5: return VK_FORMAT_ASTC_6x5_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_6x5_KHR
- case GlFormat::RGBA_ASTC_6x6: return VK_FORMAT_ASTC_6x6_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_6x6_KHR
- case GlFormat::RGBA_ASTC_8x5: return VK_FORMAT_ASTC_8x5_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_8x5_KHR
- case GlFormat::RGBA_ASTC_8x6: return VK_FORMAT_ASTC_8x6_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_8x6_KHR
- case GlFormat::RGBA_ASTC_8x8: return VK_FORMAT_ASTC_8x8_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_8x8_KHR
- case GlFormat::RGBA_ASTC_10x5: return VK_FORMAT_ASTC_10x5_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_10x5_KHR
- case GlFormat::RGBA_ASTC_10x6: return VK_FORMAT_ASTC_10x6_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_10x6_KHR
- case GlFormat::RGBA_ASTC_10x8: return VK_FORMAT_ASTC_10x8_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_10x8_KHR
- case GlFormat::RGBA_ASTC_10x10: return VK_FORMAT_ASTC_10x10_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_10x10_KHR
- case GlFormat::RGBA_ASTC_12x10: return VK_FORMAT_ASTC_12x10_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_12x10_KHR
- case GlFormat::RGBA_ASTC_12x12: return VK_FORMAT_ASTC_12x12_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_12x12_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_4x4: return VK_FORMAT_ASTC_4x4_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_5x4: return VK_FORMAT_ASTC_5x4_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_5x5: return VK_FORMAT_ASTC_5x5_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_6x5: return VK_FORMAT_ASTC_6x5_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_6x6: return VK_FORMAT_ASTC_6x6_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_8x5: return VK_FORMAT_ASTC_8x5_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_8x6: return VK_FORMAT_ASTC_8x6_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_8x8: return VK_FORMAT_ASTC_8x8_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_10x5: return VK_FORMAT_ASTC_10x5_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_10x6: return VK_FORMAT_ASTC_10x6_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_10x8: return VK_FORMAT_ASTC_10x8_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_10x10: return VK_FORMAT_ASTC_10x10_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_12x10: return VK_FORMAT_ASTC_12x10_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR
- case GlFormat::SRGB8_Alpha8_ASTC_12x12: return VK_FORMAT_ASTC_12x12_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
-
- // sRGB formats
- case GlFormat::SRGB8: return VK_FORMAT_R8G8B8_SRGB; // GL_SRGB8
- case GlFormat::SRGB8_Alpha8: return VK_FORMAT_R8G8B8A8_SRGB; // GL_SRGB8_ALPHA8
- case GlFormat::SRGB_DXT1: return VK_FORMAT_BC1_RGB_SRGB_BLOCK; // GL_COMPRESSED_SRGB_S3TC_DXT1_EXT
- case GlFormat::SRGB_Alpha_DXT1: return VK_FORMAT_BC1_RGBA_SRGB_BLOCK; // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
- case GlFormat::SRGB_Alpha_DXT3: return VK_FORMAT_BC2_SRGB_BLOCK; // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
- case GlFormat::SRGB_Alpha_DXT5: return VK_FORMAT_BC3_SRGB_BLOCK; // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
- case GlFormat::SRGB_BP_UNorm: return VK_FORMAT_BC7_SRGB_BLOCK; // GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
-
- // ES 2 formats
-// case GlFormat::DepthFormat: return VK_FORMAT_DEPTH_COMPONENT; // GL_DEPTH_COMPONENT
-// case GlFormat::AlphaFormat: return VK_FORMAT_ALPHA; // GL_ALPHA
-// case GlFormat::RGBFormat: return VK_FORMAT_RGB; // GL_RGB
-// case GlFormat::RGBAFormat: return VK_FORMAT_RGBA; // GL_RGBA
-// case GlFormat::LuminanceFormat: return VK_FORMAT_LUMINANCE; // GL_LUMINANCE
-// case GlFormat::LuminanceAlphaFormat: return VK_FORMAT;
- 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
deleted file mode 100644
index 580271b593..0000000000
--- a/src/platformsupport/vkconvenience/qvkconvenience_p.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QVKCONVENIENCE_P_H
-#define QVKCONVENIENCE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qglobal.h>
-#include <qvulkaninstance.h>
-
-QT_BEGIN_NAMESPACE
-
-class QVkConvenience
-{
-public:
-#if QT_CONFIG(opengl)
- static VkFormat vkFormatFromGlFormat(uint glFormat);
-#endif
-};
-
-QT_END_NAMESPACE
-
-#endif // QVKCONVENIENCE_P_H
diff --git a/src/platformsupport/vkconvenience/vkconvenience.pro b/src/platformsupport/vkconvenience/vkconvenience.pro
deleted file mode 100644
index f3ada5768a..0000000000
--- a/src/platformsupport/vkconvenience/vkconvenience.pro
+++ /dev/null
@@ -1,20 +0,0 @@
-TARGET = QtVulkanSupport
-MODULE = vulkan_support
-
-QT = core-private gui-private
-qtConfig(opengl): QT += opengl
-
-CONFIG += static internal_module
-
-DEFINES += QT_NO_CAST_FROM_ASCII
-PRECOMPILED_HEADER = ../../corelib/global/qt_pch.h
-
-SOURCES += \
- qvkconvenience.cpp \
- qbasicvulkanplatforminstance.cpp
-
-HEADERS += \
- qvkconvenience_p.h \
- qbasicvulkanplatforminstance_p.h
-
-load(qt_module)