fix VkFlags64 bitmasks

This commit is contained in:
2026-04-15 19:38:52 +02:00
parent 2310ab969f
commit 8af4d8be84
2 changed files with 362 additions and 349 deletions

View File

@@ -270,15 +270,25 @@ class EnumFeature : VulkanFeature
lastCaseName = enumcase.name;
}
str.Append("\t// pretty names\n");
StringView prefix = name;
String prefix = scope .(name);
for (let t in tags)
{
if (!prefix.EndsWith(t)) continue;
prefix.RemoveFromEnd(t.Length);
prefix.Length -= t.Length;
break;
}
if (prefix.EndsWith("FlagBits"))
prefix.RemoveFromEnd(8);
{
char8 digit = '\0';
if (prefix[^1].IsDigit)
{
digit = prefix[^1];
prefix.Length--;
}
if (prefix.EndsWith("FlagBits"))
prefix.Length -= 8;
if (digit != '\0')
prefix.Append(digit);
}
String lastName = scope .(128);
for (let enumcase in cases)
{
@@ -331,6 +341,7 @@ class EnumFeature : VulkanFeature
str.Remove(index, strI);
}
str.Append(tag);
if (str[index] == '_') str.Remove(index);
if (str[index].IsDigit) str.Insert(index, '_');
}
@@ -598,6 +609,8 @@ class RegistryParser : XmlParser
case "bitmask":
strBuf.Set("typealias ");
bitmask_requires.Set(atts.GetValueOrDefault("requires"));
if (bitmask_requires.IsEmpty)
bitmask_requires.Set(atts.GetValueOrDefault("bitvalues"));
eStack.Add(.Type_Bitmask);
case "basetype":
strBuf.Clear();