vulkan/util: cast enums to int64_t in switch

With the new Vulkan Video extensions a bunch of enum values have been
added. The problem is that those are behind #ifdef so our generated
code complains that we using enum values not defined.

Since we're not using enum names but integer values, we can silence
all those by casting the enum type to int64_t.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10304>
This commit is contained in:
Lionel Landwerlin 2021-04-18 12:45:01 +03:00 committed by Marge Bot
parent a49ef6e731
commit f90d625841
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ C_TEMPLATE = Template(textwrap.dedent(u"""\
const char *
vk_${enum.name[2:]}_to_str(${enum.name} input)
{
switch(input) {
switch((int64_t)input) {
% for v in sorted(enum.values.keys()):
case ${v}:
return "${enum.values[v]}";