Add new extension inspection functions getExtensionPromotedTo() and isExtensionPromoted() (#1553)

This commit is contained in:
Andreas Süßenbach
2023-04-04 10:45:15 +02:00
committed by GitHub
parent 678295aa75
commit be1bb7645f
5 changed files with 499 additions and 3 deletions

View File

@@ -12,19 +12,32 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
// VulkanHpp Samples : FormatTraits
// Compile test on using format traits functions
// VulkanHpp Tests : ExtensionInspection
// Compile test on using extension inspection functions
#include <vulkan/vulkan_extension_inspection.hpp>
int main( int /*argc*/, char ** /*argv*/ )
{
#if ( 201907 <= __cpp_constexpr ) && ( !defined( __GNUC__ ) || ( 110300 < GCC_VERSION ) )
static_assert( vk::isInstanceExtension( VK_KHR_SURFACE_EXTENSION_NAME ), "static_assert test failed" );
static_assert( vk::isDeviceExtension( VK_KHR_SWAPCHAIN_EXTENSION_NAME ), "static assert test failed" );
static_assert( vk::isExtensionDeprecated( VK_EXT_DEBUG_REPORT_EXTENSION_NAME ), "static assert test failed" );
static_assert( vk::getExtensionDeprecatedBy( VK_EXT_DEBUG_REPORT_EXTENSION_NAME ) == VK_EXT_DEBUG_UTILS_EXTENSION_NAME, "static assert test failed" );
static_assert( vk::isExtensionPromoted( VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME ), "static assert test failed" );
static_assert( vk::getExtensionPromotedTo( VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME ) == "VK_VERSION_1_2", "static assert test failed" );
#endif
bool ok = vk::isInstanceExtension( VK_KHR_SURFACE_EXTENSION_NAME ) && vk::isDeviceExtension( VK_KHR_SWAPCHAIN_EXTENSION_NAME );
(void)ok; // keep the compiler silent
(void)ok; // keep the compiler silent
if ( vk::isExtensionDeprecated( VK_EXT_DEBUG_REPORT_EXTENSION_NAME ) )
{
std::string ext = vk::getExtensionDeprecatedBy( VK_EXT_DEBUG_REPORT_EXTENSION_NAME );
}
if ( vk::isExtensionPromoted( VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME ) )
{
std::string ext = vk::getExtensionPromotedTo( VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME );
}
return 0;
}