From 08bbbe892f024d534f84d1c6c6da6a45c2456d68 Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Tue, 9 Nov 2021 08:57:08 +0100 Subject: [PATCH] Check for "VK_API_VERSION_m_n" or "VK_VERSION_m_n" in SPIRVCapabilities and SPIRVExtensions --- VulkanHppGenerator.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 4a8ba4c..d535d1e 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -13338,11 +13338,14 @@ void VulkanHppGenerator::readSPIRVCapabilitiesSPIRVCapabilityEnableVersion( for ( auto const & attribute : attributes ) { assert( attribute.first == "version" ); - check( beginsWith( attribute.second, "VK_API_VERSION_" ), + std::string feature = attribute.second; + if ( beginsWith( feature, "VK_API_" ) ) + { + feature.erase( 3, 4 ); // remove "API_" from the version -> VK_VERSION_x_y + } + check( beginsWith( feature, "VK_VERSION_" ), xmlLine, "unknown version <" + attribute.second + "> specified for SPIR-V capability" ); - std::string feature = attribute.second; - feature.erase( 3, 4 ); // remove "API_" from the version -> VK_VERSION_x_y check( m_features.find( feature ) != m_features.end(), xmlLine, "unknown version <" + attribute.second + "> specified for SPIR-V capability" ); @@ -13398,11 +13401,14 @@ void VulkanHppGenerator::readSPIRVExtensionsExtensionEnable( tinyxml2::XMLElemen else { assert( attribute.first == "version" ); - check( beginsWith( attribute.second, "VK_API_VERSION_" ), + std::string feature = attribute.second; + if ( beginsWith( feature, "VK_API_" ) ) + { + feature.erase( 3, 4 ); // remove "API_" from the version -> VK_VERSION_x_y + } + check( beginsWith( feature, "VK_VERSION_" ), line, "unknown version <" + attribute.second + "> specified for SPIR-V extension" ); - std::string feature = attribute.second; - feature.erase( 3, 4 ); // remove "API_" from the version -> VK_VERSION_x_y check( m_features.find( feature ) != m_features.end(), line, "unknown version <" + attribute.second + "> specified for SPIR-V extension" );