From dc4c24da0394c03f150a02e3f7f6fd1dc000f350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 26 Sep 2019 16:34:07 +0200 Subject: [PATCH] Vk: fix handling of unsupported formats. Until now, Vulkan supported all formats. With the 3D ASTC ones not anymore and that uncovered a bug. --- src/Magnum/Vk/Enums.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Vk/Enums.cpp b/src/Magnum/Vk/Enums.cpp index ab182b63f..fdea1c770 100644 --- a/src/Magnum/Vk/Enums.cpp +++ b/src/Magnum/Vk/Enums.cpp @@ -52,9 +52,11 @@ constexpr VkIndexType IndexTypeMapping[]{ }; #ifndef DOXYGEN_GENERATING_OUTPUT /* It gets *really* confused */ +static_assert(VK_FORMAT_UNDEFINED == 0, "VK_FORMAT_UNDEFINED is assumed to be 0"); + constexpr VkFormat FormatMapping[] { #define _c(input, format) VK_FORMAT_ ## format, - #define _s(input) VkFormat(~UnsignedInt{}), + #define _s(input) {}, #include "Magnum/Vk/Implementation/formatMapping.hpp" #undef _s #undef _c @@ -62,7 +64,7 @@ constexpr VkFormat FormatMapping[] { constexpr VkFormat CompressedFormatMapping[] { #define _c(input, format) VK_FORMAT_ ## format, - #define _s(input) VkFormat(~UnsignedInt{}), + #define _s(input) {}, #include "Magnum/Vk/Implementation/compressedFormatMapping.hpp" #undef _s #undef _c