fix VkFlags64 bitmasks
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user