Don't fail build if Vulkan headers are different

If a project that uses SwiftShader already imports the Vulkan::Headers
target, and these are different from the version in SwiftShader, we
fail to build because we have a static_assert to match the exact
version. Replace compile-time assert with a runtime assert to make
sure our code still works with different versions of the headers.

This fixes Amber building against SwiftShader.

Bug: b/154215163
Change-Id: I39e32370b51c702ab6d0a9790d06c31537f27472
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43973
Tested-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Vulkan/VkFormat.cpp b/src/Vulkan/VkFormat.cpp
index c3cc876..7d4d314 100644
--- a/src/Vulkan/VkFormat.cpp
+++ b/src/Vulkan/VkFormat.cpp
@@ -2601,7 +2601,6 @@
 	return 0;
 }
 
-static_assert(VK_HEADER_VERSION == 128, "Update VkFormat to uint8_t mapping if needed");
 static_assert(pack(VK_FORMAT_UNDEFINED) == 0, "Incorrect VkFormat packed value");
 static_assert(pack(VK_FORMAT_ASTC_12x12_SRGB_BLOCK) == 184, "Incorrect VkFormat packed value");
 static_assert(pack(VK_FORMAT_G8B8G8R8_422_UNORM) == 185, "Incorrect VkFormat packed value");
@@ -2614,8 +2613,9 @@
 uint8_t Format::mapTo8bit(VkFormat format)
 {
 	ASSERT(format <= VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM);
-
-	return pack(format);
+	uint8_t packed = pack(format);
+	ASSERT_MSG(packed > 0, "Update VkFormat to uint8_t mapping");
+	return packed;
 }
 
 }  // namespace vk