mirror of
https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git
synced 2025-05-15 09:18:49 +00:00
Add testing for vk_enum_string_helper.h
Use magic_enum to test vk_enum_string_helper.h closes #46
This commit is contained in:
parent
c8a4566f89
commit
6999ef9b82
5 changed files with 105 additions and 18 deletions
|
@ -31,20 +31,6 @@ class EnumStringHelperOutputGenerator(BaseGenerator):
|
|||
#include <vulkan/vulkan.h>
|
||||
''')
|
||||
|
||||
# TODO - this should be moved into different generated util file
|
||||
out.append('\nstatic inline bool IsDuplicatePnext(VkStructureType input_value) {\n')
|
||||
out.append(' switch (input_value) {\n')
|
||||
|
||||
for struct in [x for x in self.vk.structs.values() if x.allowDuplicate and x.sType is not None]:
|
||||
# The sType will always be first member of struct
|
||||
out.append(f' case {struct.sType}:\n')
|
||||
out.append(' return true;\n')
|
||||
out.append(' default:\n')
|
||||
out.append(' return false;\n')
|
||||
out.append(' }\n')
|
||||
out.append('}\n')
|
||||
out.append('\n')
|
||||
|
||||
# If there are no fields (empty enum) ignore
|
||||
for enum in [x for x in self.vk.enums.values() if len(x.fields) > 0]:
|
||||
groupType = enum.name if enum.bitWidth == 32 else 'uint64_t'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue