Expose the Vulkan 1.4 core API
Non-trivial update this time. Recent vk.xml adds the option of listing "vulkiansc" in the api attribute, which we did not handle before in qvkgen for command elements at all, and was not treated as a comma-separated list for feature elements. Fix these up. Also add 1.4 in QVulkanDefaultInstance, so that 1.4 goes into VkApplicationInfo.apiVersion, when available, incl. in Qt Quick. [ChangeLog][QtGui] QVulkanFunctions and QVulkanDeviceFunctions are updated to expose the Vulkan 1.4 API as long as Qt is built against Vulkan 1.4 headers. [ChangeLog][Third-Party Code] Updated vk.xml to 1.4.308. Change-Id: I8bc4bb578575bcbb189286a26617cd0052241be5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
parent
53fb13456f
commit
ff7dfd7216
@ -8,12 +8,12 @@
|
|||||||
"Files": "vk.xml",
|
"Files": "vk.xml",
|
||||||
|
|
||||||
"Homepage": "https://www.khronos.org/",
|
"Homepage": "https://www.khronos.org/",
|
||||||
"PURL": "pkg:github/KhronosGroup/Vulkan-Docs@v$<VERSION>?download_url=https://github.com/KhronosGroup/Vulkan-Docs/blob/v1.3.223/xml/vk.xml",
|
"PURL": "pkg:github/KhronosGroup/Vulkan-Docs@v$<VERSION>?download_url=https://github.com/KhronosGroup/Vulkan-Docs/blob/v1.4.308/xml/vk.xml",
|
||||||
"CPE": "cpe:2.3:a:khronos:vulkan:1.3.223:*:*:*:*:*:*:*",
|
"CPE": "cpe:2.3:a:khronos:vulkan:1.4.308:*:*:*:*:*:*:*",
|
||||||
"Version": "1.3.223",
|
"Version": "1.4.308",
|
||||||
"License": "Apache License 2.0 or MIT License",
|
"License": "Apache License 2.0 or MIT License",
|
||||||
"LicenseId": "Apache-2.0 OR MIT",
|
"LicenseId": "Apache-2.0 OR MIT",
|
||||||
"LicenseFile": "LICENSE.txt",
|
"LicenseFile": "LICENSE.txt",
|
||||||
"Copyright": "Copyright (c) 2015-2022 The Khronos Group Inc."
|
"Copyright": "Copyright (c) 2015-2025 The Khronos Group Inc."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -38,8 +38,8 @@ QVulkanInstance *QVulkanDefaultInstance::instance()
|
|||||||
s_vulkanInstance = new QVulkanInstance;
|
s_vulkanInstance = new QVulkanInstance;
|
||||||
|
|
||||||
// With a Vulkan implementation >= 1.1 we can check what
|
// With a Vulkan implementation >= 1.1 we can check what
|
||||||
// vkEnumerateInstanceVersion() says and request 1.3/1.2/1.1 based on the
|
// vkEnumerateInstanceVersion() says and request 1.4-1.1 based on the
|
||||||
// result. To prevent future surprises, be conservative and ignore any > 1.3
|
// result. To prevent future surprises, be conservative and ignore any > 1.4
|
||||||
// versions for now. For 1.0 implementations nothing will be requested, the
|
// versions for now. For 1.0 implementations nothing will be requested, the
|
||||||
// default 0 in VkApplicationInfo means 1.0.
|
// default 0 in VkApplicationInfo means 1.0.
|
||||||
//
|
//
|
||||||
@ -54,7 +54,9 @@ QVulkanInstance *QVulkanDefaultInstance::instance()
|
|||||||
// be able to make an appropriate setApiVersion() call on it.
|
// be able to make an appropriate setApiVersion() call on it.
|
||||||
|
|
||||||
const QVersionNumber supportedVersion = s_vulkanInstance->supportedApiVersion();
|
const QVersionNumber supportedVersion = s_vulkanInstance->supportedApiVersion();
|
||||||
if (supportedVersion >= QVersionNumber(1, 3))
|
if (supportedVersion >= QVersionNumber(1, 4))
|
||||||
|
s_vulkanInstance->setApiVersion(QVersionNumber(1, 4));
|
||||||
|
else if (supportedVersion >= QVersionNumber(1, 3))
|
||||||
s_vulkanInstance->setApiVersion(QVersionNumber(1, 3));
|
s_vulkanInstance->setApiVersion(QVersionNumber(1, 3));
|
||||||
else if (supportedVersion >= QVersionNumber(1, 2))
|
else if (supportedVersion >= QVersionNumber(1, 2))
|
||||||
s_vulkanInstance->setApiVersion(QVersionNumber(1, 2));
|
s_vulkanInstance->setApiVersion(QVersionNumber(1, 2));
|
||||||
|
12685
src/gui/vulkan/vk.xml
12685
src/gui/vulkan/vk.xml
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,8 @@ static const QStringList VERSIONS = {
|
|||||||
QStringLiteral("VK_VERSION_1_0"), // must be the first and always present
|
QStringLiteral("VK_VERSION_1_0"), // must be the first and always present
|
||||||
QStringLiteral("VK_VERSION_1_1"),
|
QStringLiteral("VK_VERSION_1_1"),
|
||||||
QStringLiteral("VK_VERSION_1_2"),
|
QStringLiteral("VK_VERSION_1_2"),
|
||||||
QStringLiteral("VK_VERSION_1_3")
|
QStringLiteral("VK_VERSION_1_3"),
|
||||||
|
QStringLiteral("VK_VERSION_1_4")
|
||||||
};
|
};
|
||||||
|
|
||||||
class VkSpecParser
|
class VkSpecParser
|
||||||
@ -102,7 +103,7 @@ void VkSpecParser::parseFeature()
|
|||||||
else if (attr.name() == QStringLiteral("name"))
|
else if (attr.name() == QStringLiteral("name"))
|
||||||
versionName = attr.value().toString().trimmed();
|
versionName = attr.value().toString().trimmed();
|
||||||
}
|
}
|
||||||
const bool isVulkan = api == QStringLiteral("vulkan");
|
const bool isVulkan = api.split(',').contains(QStringLiteral("vulkan"));
|
||||||
|
|
||||||
while (!m_reader.atEnd()) {
|
while (!m_reader.atEnd()) {
|
||||||
m_reader.readNext();
|
m_reader.readNext();
|
||||||
@ -144,7 +145,7 @@ void VkSpecParser::parseCommands()
|
|||||||
return;
|
return;
|
||||||
if (m_reader.isStartElement() && m_reader.name() == QStringLiteral("command")) {
|
if (m_reader.isStartElement() && m_reader.name() == QStringLiteral("command")) {
|
||||||
const Command c = parseCommand();
|
const Command c = parseCommand();
|
||||||
if (!c.cmd.name.isEmpty()) // skip aliases
|
if (!c.cmd.name.isEmpty()) // skip aliases and commands for another api
|
||||||
m_commands.append(c);
|
m_commands.append(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -160,6 +161,17 @@ VkSpecParser::Command VkSpecParser::parseCommand()
|
|||||||
// <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
|
// <param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
|
||||||
// <param><type>VkInstance</type>* <name>pInstance</name></param>
|
// <param><type>VkInstance</type>* <name>pInstance</name></param>
|
||||||
|
|
||||||
|
QString api;
|
||||||
|
for (const QXmlStreamAttribute &attr : m_reader.attributes()) {
|
||||||
|
if (attr.name() == QStringLiteral("api"))
|
||||||
|
api = attr.value().toString().trimmed();
|
||||||
|
}
|
||||||
|
// skip commands with api="vulkansc", but the api attribute is optional
|
||||||
|
if (!api.isEmpty() && !api.split(',').contains(QStringLiteral("vulkan"))) {
|
||||||
|
skip();
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
while (!m_reader.atEnd()) {
|
while (!m_reader.atEnd()) {
|
||||||
m_reader.readNext();
|
m_reader.readNext();
|
||||||
if (m_reader.isEndElement() && m_reader.name() == QStringLiteral("command"))
|
if (m_reader.isEndElement() && m_reader.name() == QStringLiteral("command"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user