layers: replace VUID error map with struct
Replace the std::unordered_map container holding the VUID -> spec text
mapping with a vanilla struct of char * literal strings. The map is
now built on first use from the string table.
This change is a workaround for slow build times observed with use of
the directly initialized unordered_map, in particular on 32-bit Android
builds.
Change-Id: Ic0ab0bf443a57ee616b3cac17fc8ea0442e6d0c2
diff --git a/scripts/vk_validation_stats.py b/scripts/vk_validation_stats.py
index faacdf3..a4619bc 100755
--- a/scripts/vk_validation_stats.py
+++ b/scripts/vk_validation_stats.py
@@ -493,17 +493,16 @@
// Disable auto-formatting for generated file
// clang-format off
-#include <string>
-#include <unordered_map>
-
// Mapping from VUID string to the corresponding spec text
-#ifdef VALIDATION_ERROR_MAP_IMPL
-std::unordered_map<std::string, std::string> vuid_to_error_text_map {
+typedef struct _vuid_spec_text_pair {
+ const char * vuid;
+ const char * spec_text;
+} vuid_spec_text_pair;
+
+static const vuid_spec_text_pair vuid_spec_text[] = {
"""
self.header_postamble = """};
-#else
-extern std::unordered_map<std::string, std::string> vuid_to_error_text_map;
-#endif"""
+"""
self.spec_url = "https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html"
def dump_txt(self):