*/
#include <vulkan/vulkan.h>
+ #include <vulkan/vk_android_native_buffer.h>
#include "util/macros.h"
#include "vk_enum_to_str.h"
{
switch(input) {
% for v in enum.values:
+ % if v in FOREIGN_ENUM_VALUES:
+
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wswitch"
+ % endif
case ${v}:
return "${v}";
+ % if v in FOREIGN_ENUM_VALUES:
+ #pragma GCC diagnostic pop
+
+ % endif
% endfor
default:
unreachable("Undefined enum value.");
#define MESA_VK_ENUM_TO_STR_H
#include <vulkan/vulkan.h>
+ #include <vulkan/vk_android_native_buffer.h>
% for enum in enums:
const char * vk_${enum.name[2:]}_to_str(${enum.name} input);
#endif"""),
output_encoding='utf-8')
+# These enums are defined outside their respective enum blocks, and thus cause
+# -Wswitch warnings.
+FOREIGN_ENUM_VALUES = [
+ "VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID",
+]
+
class EnumFactory(object):
"""Factory for creating enums."""
f.write(template.render(
file=os.path.basename(__file__),
enums=efactory.registry.values(),
- copyright=COPYRIGHT))
+ copyright=COPYRIGHT,
+ FOREIGN_ENUM_VALUES=FOREIGN_ENUM_VALUES))
if __name__ == '__main__':