diff --git a/.silktouch/openal-clangsharp.stout b/.silktouch/openal-clangsharp.stout
index 98539cef7f..994e242e2e 100644
Binary files a/.silktouch/openal-clangsharp.stout and b/.silktouch/openal-clangsharp.stout differ
diff --git a/.silktouch/opengl-clangsharp.stout b/.silktouch/opengl-clangsharp.stout
index 5d519a64d8..0696b43007 100644
Binary files a/.silktouch/opengl-clangsharp.stout and b/.silktouch/opengl-clangsharp.stout differ
diff --git a/.silktouch/vulkan-clangsharp.stout b/.silktouch/vulkan-clangsharp.stout
index 07058b6ad7..d905b7ace2 100644
Binary files a/.silktouch/vulkan-clangsharp.stout and b/.silktouch/vulkan-clangsharp.stout differ
diff --git a/generator.json b/generator.json
index 83293d8003..8bbae05cda 100644
--- a/generator.json
+++ b/generator.json
@@ -147,6 +147,7 @@
"SpecPath": "eng/submodules/opengl/xml/gl.xml",
"Namespace": "Silk.NET.OpenGL",
"TypeMap": {
+ "GLenum": "uint",
"TraceMaskMESA": "uint",
"PathRenderingTokenNV": "byte",
"PathCoordType": "byte"
@@ -252,6 +253,10 @@
"MixKhronosData": {
"SpecPath": "eng/submodules/openal-soft/registry/xml/al.xml",
"Namespace": "Silk.NET.OpenAL",
+ "TypeMap": {
+ "ALenum": "uint",
+ "ALCenum": "uint"
+ },
"NonStandardExtensionNomenclature": true,
"Vendors": [
"SOFT",
diff --git a/sources/OpenAL/OpenAL/Enums/ALCEnum.gen.cs b/sources/OpenAL/OpenAL/Enums/ALCEnum.gen.cs
index ff0db8e938..9cc6dac56b 100644
--- a/sources/OpenAL/OpenAL/Enums/ALCEnum.gen.cs
+++ b/sources/OpenAL/OpenAL/Enums/ALCEnum.gen.cs
@@ -10,7 +10,7 @@
namespace Silk.NET.OpenAL;
-[NativeName("ALCEnum")]
+[NativeName("ALCenum")]
public enum ALCEnum : uint
{
[NativeName("ALC_INVALID")]
diff --git a/sources/OpenAL/OpenAL/Enums/ALEnum.gen.cs b/sources/OpenAL/OpenAL/Enums/ALEnum.gen.cs
index 97f9834ade..d7afdb321d 100644
--- a/sources/OpenAL/OpenAL/Enums/ALEnum.gen.cs
+++ b/sources/OpenAL/OpenAL/Enums/ALEnum.gen.cs
@@ -10,7 +10,7 @@
namespace Silk.NET.OpenAL;
-[NativeName("ALEnum")]
+[NativeName("ALenum")]
public enum ALEnum : uint
{
[NativeName("AL_NONE")]
diff --git a/sources/OpenGL/OpenGL/Enums/FragmentShaderDestMask.gen.cs b/sources/OpenGL/OpenGL/Enums/FragmentShaderDestMask.gen.cs
index de8a534448..5a3ac06402 100644
--- a/sources/OpenGL/OpenGL/Enums/FragmentShaderDestMask.gen.cs
+++ b/sources/OpenGL/OpenGL/Enums/FragmentShaderDestMask.gen.cs
@@ -8,17 +8,18 @@
namespace Silk.NET.OpenGL;
[NativeName("FragmentShaderDestMaskATI")]
+[Flags]
public enum FragmentShaderDestMask : uint
{
[NativeName("GL_NONE")]
- None = 0,
+ None = 0x0,
[NativeName("GL_RED_BIT_ATI")]
- RedBitATI = 1,
+ RedBitATI = 0x1,
[NativeName("GL_GREEN_BIT_ATI")]
- GreenBitATI = 2,
+ GreenBitATI = 0x2,
[NativeName("GL_BLUE_BIT_ATI")]
- BlueBitATI = 4,
+ BlueBitATI = 0x4,
}
diff --git a/sources/OpenGL/OpenGL/Enums/FragmentShaderDestModMask.gen.cs b/sources/OpenGL/OpenGL/Enums/FragmentShaderDestModMask.gen.cs
index 59bc20c93d..cf98b9ca92 100644
--- a/sources/OpenGL/OpenGL/Enums/FragmentShaderDestModMask.gen.cs
+++ b/sources/OpenGL/OpenGL/Enums/FragmentShaderDestModMask.gen.cs
@@ -8,29 +8,30 @@
namespace Silk.NET.OpenGL;
[NativeName("FragmentShaderDestModMaskATI")]
+[Flags]
public enum FragmentShaderDestModMask : uint
{
[NativeName("GL_NONE")]
- None = 0,
+ None = 0x0,
[NativeName("GL_2X_BIT_ATI")]
- X2XBitATI = 1,
+ X2XBitATI = 0x1,
[NativeName("GL_4X_BIT_ATI")]
- X4XBitATI = 2,
+ X4XBitATI = 0x2,
[NativeName("GL_8X_BIT_ATI")]
- X8XBitATI = 4,
+ X8XBitATI = 0x4,
[NativeName("GL_HALF_BIT_ATI")]
- HalfBitATI = 8,
+ HalfBitATI = 0x8,
[NativeName("GL_QUARTER_BIT_ATI")]
- QuarterBitATI = 16,
+ QuarterBitATI = 0x10,
[NativeName("GL_EIGHTH_BIT_ATI")]
- EighthBitATI = 32,
+ EighthBitATI = 0x20,
[NativeName("GL_SATURATE_BIT_ATI")]
- SaturateBitATI = 64,
+ SaturateBitATI = 0x40,
}
diff --git a/sources/OpenGL/OpenGL/Enums/GLEnum.gen.cs b/sources/OpenGL/OpenGL/Enums/GLEnum.gen.cs
index 3109da5ed0..c1f9b5201f 100644
--- a/sources/OpenGL/OpenGL/Enums/GLEnum.gen.cs
+++ b/sources/OpenGL/OpenGL/Enums/GLEnum.gen.cs
@@ -7,7 +7,7 @@
namespace Silk.NET.OpenGL;
-[NativeName("GLEnum")]
+[NativeName("GLenum")]
public enum GLEnum : uint
{
[NativeName("GL_DEPTH_BUFFER_BIT")]
diff --git a/sources/OpenGL/OpenGL/Enums/PathFontStyle.gen.cs b/sources/OpenGL/OpenGL/Enums/PathFontStyle.gen.cs
index 0243f93931..63ade9981e 100644
--- a/sources/OpenGL/OpenGL/Enums/PathFontStyle.gen.cs
+++ b/sources/OpenGL/OpenGL/Enums/PathFontStyle.gen.cs
@@ -8,14 +8,15 @@
namespace Silk.NET.OpenGL;
[NativeName("PathFontStyle")]
+[Flags]
public enum PathFontStyle : uint
{
[NativeName("GL_NONE")]
- None = 0,
+ None = 0x0,
[NativeName("GL_BOLD_BIT_NV")]
- BoldBitNV = 1,
+ BoldBitNV = 0x1,
[NativeName("GL_ITALIC_BIT_NV")]
- ItalicBitNV = 2,
+ ItalicBitNV = 0x2,
}
diff --git a/sources/SilkTouch/SilkTouch/Mods/MixKhronosData.cs b/sources/SilkTouch/SilkTouch/Mods/MixKhronosData.cs
index 51bba6e3e6..0c26dd5429 100644
--- a/sources/SilkTouch/SilkTouch/Mods/MixKhronosData.cs
+++ b/sources/SilkTouch/SilkTouch/Mods/MixKhronosData.cs
@@ -248,8 +248,6 @@ public async Task InitializeAsync(IModContext ctx, CancellationToken ct = defaul
job.TypeMap.TryAdd("uint32_t", "uint");
job.TypeMap.TryAdd("int64_t", "long");
job.TypeMap.TryAdd("uint64_t", "ulong");
- job.TypeMap.TryAdd("GLenum", "uint");
- job.TypeMap.TryAdd("GLbitfield", "uint");
if (specPath is null)
{
// No metadata, can't continue. It'd be odd if the Khronos mod is being used in this case. There was once
@@ -442,22 +440,55 @@ rsp with
return Task.FromResult(rsps);
}
- /// The name of the group. This is the name used for the C# enum.
- /// The native name of the group, if available. This is the name used for the [NativeName] attribute.
- ///
- ///
- ///
- ///
- ///
- internal record EnumGroup(
- string Name,
- string? NativeName,
- string? Type,
- List Enums,
- bool KnownBitmask,
- string? ExclusiveVendor,
- string? Namespace
- );
+ ///
+ /// Contains information about a group of enums.
+ ///
+ ///
+ /// There are two bitmask properties to better handle OpenGL-style enums.
+ /// Some enums are explicitly stated to be bitmasks while some have to be inferred.
+ ///
+ internal record EnumGroup
+ {
+ ///
+ /// The name of the group. This is the name used for the C# enum.
+ ///
+ public required string Name { get; init; }
+
+ ///
+ /// The native name of the group. This is the name used for the [NativeName] attribute.
+ ///
+ public required string NativeName { get; init; }
+
+ ///
+ /// The base type of the group.
+ ///
+ public string? BaseType { get; init; }
+
+ ///
+ /// Members of this group extracted from other parts of the generated bindings.
+ ///
+ public List Enums { get; init; } = [];
+
+ ///
+ /// Whether the group is explicitly known to be a bitmask, i.e., it is stated in the XML spec.
+ ///
+ public bool IsDefinitelyBitmask { get; init; }
+
+ ///
+ /// Whether the group is likely a bitmask based on heuristics.
+ ///
+ public bool IsMaybeBitmask { get; init; }
+
+ ///
+ /// The identified exclusive vendor for the group. Eg: NV.
+ ///
+ public string? ExclusiveVendor { get; init; }
+
+ ///
+ /// The namespace for the group. Eg: GL.
+ ///
+ public string? Namespace { get; init; }
+ }
private record ProfileEvaluation(
Version? StartVersion,
@@ -1546,7 +1577,7 @@ private class RewriterPhase1(JobData job, ILogger logger) : CSharpSyntaxRewriter
{
if (!AlreadyPresentGroups.Contains(groupName))
{
- var baseType = groupInfo.Type ?? groupName;
+ var baseType = groupInfo.BaseType ?? groupName;
while (job.TypeMap.TryGetValue(baseType, out var ty))
{
baseType = ty;
@@ -1761,7 +1792,10 @@ .. node.Members.Where(m =>
);
}
- if (job.Groups.TryGetValue(identifier, out var group) && group.KnownBitmask)
+ if (
+ job.Groups.TryGetValue(identifier, out var group)
+ && (group.IsDefinitelyBitmask || group.IsMaybeBitmask)
+ )
{
// Add [Flags] attribute
var flagsAttribute = AttributeList(
@@ -1986,16 +2020,18 @@ public override SyntaxNode VisitDelegateDeclaration(DelegateDeclarationSyntax no
// Trimming is done by PrettifyNames, if PrettifyNames is configured to do so
public override SyntaxNode VisitEnumDeclaration(EnumDeclarationSyntax node)
{
- var typeName = node.AttributeLists.GetNativeNameOrDefault(node.Identifier);
- var groupInfo = job.Groups.GetValueOrDefault(typeName);
+ var nativeTypeName = node.AttributeLists.GetNativeNameOrDefault(node.Identifier);
+ var managedTypeName = node.Identifier.Text;
+
+ var groupInfo = job.Groups.GetValueOrDefault(managedTypeName);
- var typeVendor = job.Vendors.FirstOrDefault(typeName.EndsWith);
+ var typeVendor = job.Vendors.FirstOrDefault(nativeTypeName.EndsWith);
var hasTypeSuffix = typeVendor != null;
var vendorAffixType = "KhronosVendor";
// Identify the namespace enum
// Eg: GLEnum, ALEnum
- if (groupInfo?.Namespace != null && typeName == $"{groupInfo.Namespace}Enum")
+ if (groupInfo?.Namespace != null && nativeTypeName == $"{groupInfo.Namespace}enum")
{
node = node.WithAttributeLists(
node.AttributeLists.AddNamePrefix("KhronosNamespaceEnum", groupInfo.Namespace)
@@ -2023,7 +2059,8 @@ public override SyntaxNode VisitEnumDeclaration(EnumDeclarationSyntax node)
// Trimming both would cause conflicts.
// Trimming one but not the other would imply one is core and the other is not.
var hasMultipleVersions =
- job.Groups.Count(x => x.Key.StartsWith(typeName[..^typeVendor.Length])) > 1;
+ job.Groups.Count(x => x.Key.StartsWith(nativeTypeName[..^typeVendor.Length]))
+ > 1;
var isSafeToTrimType = !hasMultipleVersions;
// Identify the affix for trimming if the type vendor suffix does not match the identified exclusive vendor suffix
@@ -2139,45 +2176,85 @@ public override SyntaxNode VisitMethodDeclaration(MethodDeclarationSyntax node)
[SuppressMessage("ReSharper", "MoveLocalFunctionAfterJumpStatement")]
internal void ReadGroups(XDocument doc, JobData data, HashSet vendors)
{
+ // For reference:
+ // Khronos XMLs specify enums in the following format
+ // - Top level element.
+ // - Main enum group.
+ // - Enum member.
+ //
+ // Each API has slight variations in how the XML is structured.
+ //
+ // Main enum group:
+ // Either has the "group" and "namespace" properties (OpenGL-style).
+ // Or has the "name" property.
+ //
+ // Enum member:
+ // The "group" property specifies a list of additional OpenGL-style groups the enum member belongs to.
+
// Designed to be compatible with OpenGL, EGL, WGL, GLX, and OpenCL.
- // This will work for Vulkan as well, but for Vulkan the enums are actually "typedef enum"s in the headers and
- // therefore the result of this function will go mostly ignored.
+ // This will work for Vulkan as well, but for Vulkan the enums are actually "typedef enum"s in the headers.
+ // This means that for Vulkan, this means that instead of using this information to directly generate the enums
+ // this information will mostly be used to enhance the enums scraped from the headers (eg: native name and bitmask information).
var anyNamespaced =
doc.Element("registry")?.Elements("enums").Attributes("namespace").Any() ?? false;
- var anyGLStyleGroups =
- doc.Element("registry")?.Elements("enums").Elements("enum").Attributes("group").Any()
- ?? false;
var likelyOpenCL = false; // OpenCL specific
var topLevelIntentionalExclusions = new HashSet(); // OpenCL specific
+
+ // Parse enum groups
foreach (var block in doc.Element("registry")?.Elements("enums") ?? [])
{
// Is it a bitmask?
var isBitmask = block.Attribute("type")?.Value == "bitmask";
// OpenGL/EGL/WGL/GLX namespace
- var enumNamespace = block.Attribute("namespace")?.Value;
- var groupName =
- enumNamespace is not null && !enumNamespace.All(char.IsUpper)
- ? enumNamespace
- : null;
+ var groupName = block.Attribute("group")?.Value;
var nativeName = groupName;
+ var enumNamespace = block.Attribute("namespace")?.Value;
+ var baseType = enumNamespace != null ? $"{enumNamespace}enum" : null;
- // Create an ungrouped group as well i.e. GLEnum, WGLEnum, etc
- if (enumNamespace is not null)
+ string? namespaceGroupName = null;
+ if (enumNamespace != null)
{
- groupName ??= $"{enumNamespace}Enum";
- nativeName ??= enumNamespace;
+ if (!enumNamespace.All(char.IsUpper))
+ {
+ // Use the namespace name directly if it is not all uppercase
+ // Eg: WGLLayerPlaneMask
+ namespaceGroupName = enumNamespace;
+ }
+ else
+ {
+ // Otherwise, suffix the name with -Enum
+ // Eg: GLEnum, ALEnum, WGLEnum
+ namespaceGroupName = $"{enumNamespace}Enum";
+ }
}
- // OpenCL enum name
+ // Create a group for the namespace as well i.e. GLEnum, WGLEnum, etc
+ if (namespaceGroupName is not null)
+ {
+ if (!data.Groups.TryGetValue(namespaceGroupName, out var namespaceGroup))
+ {
+ namespaceGroup = new EnumGroup()
+ {
+ Name = namespaceGroupName,
+ NativeName = $"{enumNamespace}enum",
+ BaseType = baseType,
+ Namespace = enumNamespace,
+ };
+
+ data.Groups[namespaceGroupName] = namespaceGroup;
+ }
+ }
+
+ // Vulkan/OpenXR/OpenCL enum name
if (!anyNamespaced)
{
groupName ??= block.Attribute("name")?.Value;
}
// Vulkan/OpenXR enum name
- nativeName ??= groupName;
groupName = groupName?.Replace("FlagBits", "Flags");
+ nativeName ??= groupName;
// Skip Vulkan API Constants since it is not an enum
if (block.Attribute("type")?.Value == "constants")
@@ -2191,7 +2268,9 @@ internal void ReadGroups(XDocument doc, JobData data, HashSet vendors)
// skip over the block. We continue on in the top-level case to permanently prevent any group operations
// from occurring on the top-level intentional exclusions because they're special numbers/constants.
var topLevelIntentionalExclusion =
- groupName is not null && IsIntentionalExclusion(groupName);
+ groupName != null
+ && namespaceGroupName == null
+ && IsIntentionalExclusion(groupName);
static bool IsIntentionalExclusion(string groupName) =>
groupName.StartsWith("Constants") // these are constants
|| groupName is "MiscNumbers" or "SpecialNumbers";
@@ -2207,26 +2286,50 @@ static bool IsUngroupable(string groupName) =>
FixupGroupNameForOpenCL(ref groupName, ref likelyOpenCL, ref isBitmask);
}
- // Mark the enums
- foreach (var @enum in block.Elements("enum"))
+ // Initialize the group before enum members are parsed below
+ // This ensures 3 things:
+ // 1. The native name is correct
+ // 2. Whether the enum is a bitmask is correct
+ // 3. Empty groups are recorded properly
+ if (groupName != null && !IsUngroupable(groupName))
{
- var enumName =
- @enum.Attribute("name")?.Value
+ data.Groups[groupName] = data.Groups.TryGetValue(groupName, out var group)
+ ? group with
+ {
+ IsDefinitelyBitmask = isBitmask,
+ }
+ : new EnumGroup()
+ {
+ Name = groupName,
+ NativeName = nativeName ?? groupName,
+ BaseType = baseType,
+
+ IsDefinitelyBitmask = isBitmask,
+ ExclusiveVendor = VendorFromString(groupName, vendors),
+ Namespace = enumNamespace,
+ };
+ }
+
+ // Parse enum members
+ foreach (var member in block.Elements("enum"))
+ {
+ var memberName =
+ member.Attribute("name")?.Value
?? throw new InvalidDataException("Expected \"name\" attribute on .");
if (topLevelIntentionalExclusion)
{
- topLevelIntentionalExclusions.Add(enumName);
+ topLevelIntentionalExclusions.Add(memberName);
continue;
}
// Get the group hash set for this enum.
- if (!data.EnumsToGroups.TryGetValue(enumName, out var enumToGroups))
+ if (!data.EnumsToGroups.TryGetValue(memberName, out var enumToGroups))
{
- data.EnumsToGroups[enumName] = enumToGroups = [];
+ data.EnumsToGroups[memberName] = enumToGroups = [];
}
- // OpenGL-style groups
- var glGroups = @enum
+ // Parse OpenGL-style groups
+ var additionalGroups = member
.Attribute("group")
?.Value.Split(
_listSeparators,
@@ -2234,66 +2337,64 @@ static bool IsUngroupable(string groupName) =>
);
// Get the vendor (if the enum name ends with a vendor that is).
- var thisVendor = VendorFromString(enumName, vendors);
+ var memberVendor = VendorFromString(memberName, vendors);
- foreach (
- var group in (groupName is null ? Enumerable.Empty() : [groupName])
- .Concat(glGroups ?? [])
- .Concat(block.Attribute("group")?.Value is { Length: > 0 } g ? [g] : [])
- .Distinct()
- )
+ // Add the enum member to the namespace enum, the main enum group, and its additional OpenGL-style groups
+ var memberGroupNames = new HashSet();
+ if (namespaceGroupName != null)
+ {
+ memberGroupNames.Add(namespaceGroupName);
+ }
+
+ if (groupName != null)
{
- if (IsUngroupable(group))
+ memberGroupNames.Add(groupName);
+ }
+
+ if (additionalGroups != null)
+ {
+ memberGroupNames.UnionWith(additionalGroups);
+ }
+
+ foreach (var memberGroupName in memberGroupNames)
+ {
+ if (IsUngroupable(memberGroupName))
{
continue;
}
// Update the group info.
- data.Groups[group] = data.Groups.TryGetValue(group, out var groupInfo)
- ? groupInfo with
+ data.Groups[memberGroupName] = data.Groups.TryGetValue(
+ memberGroupName,
+ out var memberGroup
+ )
+ ? memberGroup with
{
- KnownBitmask = isBitmask && groupInfo.KnownBitmask,
+ IsMaybeBitmask = isBitmask && memberGroup.IsMaybeBitmask,
ExclusiveVendor =
- thisVendor is not null && groupInfo.ExclusiveVendor == thisVendor
- ? thisVendor
+ memberVendor is not null
+ && memberGroup.ExclusiveVendor == memberVendor
+ ? memberVendor
: null,
Namespace =
- enumNamespace is not null && groupInfo.Namespace == enumNamespace
+ enumNamespace is not null && memberGroup.Namespace == enumNamespace
? enumNamespace
: null,
}
- : new EnumGroup(
- group,
- group,
- anyGLStyleGroups ? "GLenum" : null,
- [],
- isBitmask,
- thisVendor,
- enumNamespace
- );
+ : new EnumGroup()
+ {
+ Name = memberGroupName,
+ NativeName = memberGroupName,
+ BaseType = baseType,
+ IsMaybeBitmask = isBitmask,
+ ExclusiveVendor = memberVendor,
+ Namespace = enumNamespace,
+ };
// Mark this enum.
- enumToGroups.Add(group);
+ enumToGroups.Add(memberGroupName);
}
}
-
- // Some enum groups don't have members, meaning that the code above won't catch them
- if (
- groupName != null
- && !IsUngroupable(groupName)
- && !data.Groups.ContainsKey(groupName)
- )
- {
- data.Groups[groupName] = new EnumGroup(
- groupName,
- nativeName,
- null,
- [],
- isBitmask,
- VendorFromString(groupName, vendors),
- enumNamespace
- );
- }
}
var allHandles = doc.Elements("registry")
@@ -2435,16 +2536,18 @@ var @enum in doc.Elements("registry")
// it's actually correct for once.
if (!data.Groups.ContainsKey(@enum.Value))
{
- data.Groups[@enum.Value] = new EnumGroup(
- @enum.Value,
- @enum.Value,
+ data.Groups[@enum.Value] = new EnumGroup()
+ {
+ Name = @enum.Value,
+ NativeName = @enum.Value,
// cl_properties and cl_bitfield are both cl_ulong which is ulong
- "ulong",
- [],
- @enum.Parent?.Element("type")?.Value == "cl_bitfield",
- VendorFromString(@enum.Value, vendors),
- null
- );
+ // We currently use cl_bitfield to represent the backing type of OpenCL enums
+ // Decision was made here: https://github.com/dotnet/Silk.NET/pull/2534#discussion_r2686840153
+ BaseType = "cl_bitfield",
+
+ IsDefinitelyBitmask = @enum.Parent?.Element("type")?.Value == "cl_bitfield",
+ ExclusiveVendor = VendorFromString(@enum.Value, vendors),
+ };
}
}
@@ -2601,16 +2704,16 @@ is var splitList
}
else
{
- data.Groups[groupStr] = new EnumGroup(
- groupStr,
- groupStr,
- null,
- [],
- (typeStr is not null && typeStr.Contains("bitfield"))
+ data.Groups[groupStr] = new EnumGroup()
+ {
+ Name = groupStr,
+ NativeName = groupStr,
+
+ IsDefinitelyBitmask =
+ (typeStr is not null && typeStr.Contains("bitfield"))
|| group.Contains("flags"),
- thisVendor,
- null
- );
+ ExclusiveVendor = thisVendor,
+ };
}
// Get the group hash set for this enum.
diff --git a/sources/Vulkan/Vulkan/Enums/DataGraphPipelineDispatchFlagsARM.gen.cs b/sources/Vulkan/Vulkan/Enums/DataGraphPipelineDispatchFlagsARM.gen.cs
index 7fc496db2e..39e0e0c00b 100644
--- a/sources/Vulkan/Vulkan/Enums/DataGraphPipelineDispatchFlagsARM.gen.cs
+++ b/sources/Vulkan/Vulkan/Enums/DataGraphPipelineDispatchFlagsARM.gen.cs
@@ -8,7 +8,7 @@
namespace Silk.NET.Vulkan;
-[NativeName("VkDataGraphPipelineDispatchFlagBitsARM")]
+[NativeName("VkDataGraphPipelineDispatchFlagsARM")]
[Flags]
public enum DataGraphPipelineDispatchFlagsARM : ulong
{
diff --git a/sources/Vulkan/Vulkan/Enums/ImageFormatConstraintsFlagsFUCHSIA.gen.cs b/sources/Vulkan/Vulkan/Enums/ImageFormatConstraintsFlagsFUCHSIA.gen.cs
index 5f1d9fbbb7..268cc9c2ba 100644
--- a/sources/Vulkan/Vulkan/Enums/ImageFormatConstraintsFlagsFUCHSIA.gen.cs
+++ b/sources/Vulkan/Vulkan/Enums/ImageFormatConstraintsFlagsFUCHSIA.gen.cs
@@ -8,7 +8,7 @@
namespace Silk.NET.Vulkan;
-[NativeName("VkImageFormatConstraintsFlagBitsFUCHSIA")]
+[NativeName("VkImageFormatConstraintsFlagsFUCHSIA")]
[Flags]
public enum ImageFormatConstraintsFlagsFUCHSIA : uint
{
diff --git a/sources/Vulkan/Vulkan/Enums/PrivateDataSlotCreateFlags.gen.cs b/sources/Vulkan/Vulkan/Enums/PrivateDataSlotCreateFlags.gen.cs
index 1d0ca3a97a..89bcf2fbe1 100644
--- a/sources/Vulkan/Vulkan/Enums/PrivateDataSlotCreateFlags.gen.cs
+++ b/sources/Vulkan/Vulkan/Enums/PrivateDataSlotCreateFlags.gen.cs
@@ -8,7 +8,7 @@
namespace Silk.NET.Vulkan;
-[NativeName("VkPrivateDataSlotCreateFlagBits")]
+[NativeName("VkPrivateDataSlotCreateFlags")]
[Flags]
public enum PrivateDataSlotCreateFlags : uint
{
diff --git a/sources/Vulkan/Vulkan/Enums/RefreshObjectFlagsKHR.gen.cs b/sources/Vulkan/Vulkan/Enums/RefreshObjectFlagsKHR.gen.cs
index b6cc814bcd..282bba7349 100644
--- a/sources/Vulkan/Vulkan/Enums/RefreshObjectFlagsKHR.gen.cs
+++ b/sources/Vulkan/Vulkan/Enums/RefreshObjectFlagsKHR.gen.cs
@@ -8,7 +8,7 @@
namespace Silk.NET.Vulkan;
-[NativeName("VkRefreshObjectFlagBitsKHR")]
+[NativeName("VkRefreshObjectFlagsKHR")]
[Flags]
public enum RefreshObjectFlagsKHR : uint
{
diff --git a/sources/Vulkan/Vulkan/Enums/SemaphoreCreateFlags.gen.cs b/sources/Vulkan/Vulkan/Enums/SemaphoreCreateFlags.gen.cs
index 07a7451f2f..7111b0e08e 100644
--- a/sources/Vulkan/Vulkan/Enums/SemaphoreCreateFlags.gen.cs
+++ b/sources/Vulkan/Vulkan/Enums/SemaphoreCreateFlags.gen.cs
@@ -8,7 +8,7 @@
namespace Silk.NET.Vulkan;
-[NativeName("VkSemaphoreCreateFlagBits")]
+[NativeName("VkSemaphoreCreateFlags")]
[Flags]
public enum SemaphoreCreateFlags : uint
{
diff --git a/sources/Vulkan/Vulkan/Enums/ShaderModuleCreateFlags.gen.cs b/sources/Vulkan/Vulkan/Enums/ShaderModuleCreateFlags.gen.cs
index a991637ec2..d9f610d801 100644
--- a/sources/Vulkan/Vulkan/Enums/ShaderModuleCreateFlags.gen.cs
+++ b/sources/Vulkan/Vulkan/Enums/ShaderModuleCreateFlags.gen.cs
@@ -8,7 +8,7 @@
namespace Silk.NET.Vulkan;
-[NativeName("VkShaderModuleCreateFlagBits")]
+[NativeName("VkShaderModuleCreateFlags")]
[Flags]
public enum ShaderModuleCreateFlags : uint
{
diff --git a/sources/Vulkan/Vulkan/Enums/TensorViewCreateFlagsARM.gen.cs b/sources/Vulkan/Vulkan/Enums/TensorViewCreateFlagsARM.gen.cs
index 1940b94047..dab233c115 100644
--- a/sources/Vulkan/Vulkan/Enums/TensorViewCreateFlagsARM.gen.cs
+++ b/sources/Vulkan/Vulkan/Enums/TensorViewCreateFlagsARM.gen.cs
@@ -8,7 +8,7 @@
namespace Silk.NET.Vulkan;
-[NativeName("VkTensorViewCreateFlagBitsARM")]
+[NativeName("VkTensorViewCreateFlagsARM")]
[Flags]
public enum TensorViewCreateFlagsARM : ulong
{
diff --git a/sources/Vulkan/Vulkan/Enums/WaylandSurfaceCreateFlagsKHR.gen.cs b/sources/Vulkan/Vulkan/Enums/WaylandSurfaceCreateFlagsKHR.gen.cs
index ee7beea1f5..09790b1536 100644
--- a/sources/Vulkan/Vulkan/Enums/WaylandSurfaceCreateFlagsKHR.gen.cs
+++ b/sources/Vulkan/Vulkan/Enums/WaylandSurfaceCreateFlagsKHR.gen.cs
@@ -8,7 +8,7 @@
namespace Silk.NET.Vulkan;
-[NativeName("VkWaylandSurfaceCreateFlagBitsKHR")]
+[NativeName("VkWaylandSurfaceCreateFlagsKHR")]
[Flags]
public enum WaylandSurfaceCreateFlagsKHR : uint
{
diff --git a/tests/SilkTouch/SilkTouch/Khronos/MixKhronosDataTests.IdentifiesNamespaceEnumPrefix.verified.txt b/tests/SilkTouch/SilkTouch/Khronos/MixKhronosDataTests.IdentifiesNamespaceEnumPrefix.verified.txt
index a463c66a73..4a30909ca0 100644
--- a/tests/SilkTouch/SilkTouch/Khronos/MixKhronosDataTests.IdentifiesNamespaceEnumPrefix.verified.txt
+++ b/tests/SilkTouch/SilkTouch/Khronos/MixKhronosDataTests.IdentifiesNamespaceEnumPrefix.verified.txt
@@ -1,4 +1,5 @@
-[NameAffix("Prefix", "KhronosNamespaceEnum", "GL")]
+[NativeName("GLenum")]
+[NameAffix("Prefix", "KhronosNamespaceEnum", "GL")]
public enum GLEnum
{
}
\ No newline at end of file
diff --git a/tests/SilkTouch/SilkTouch/Khronos/MixKhronosDataTests.cs b/tests/SilkTouch/SilkTouch/Khronos/MixKhronosDataTests.cs
index f1644dc266..e3be2fda66 100644
--- a/tests/SilkTouch/SilkTouch/Khronos/MixKhronosDataTests.cs
+++ b/tests/SilkTouch/SilkTouch/Khronos/MixKhronosDataTests.cs
@@ -424,6 +424,7 @@ public async Task IdentifiesNamespaceEnumPrefix()
.AddDocument(
"GLEnum.gen.cs",
"""
+ [NativeName("GLenum")]
public enum GLEnum { }
"""
)
@@ -446,15 +447,13 @@ public enum GLEnum { }
{
{
"GLEnum",
- new MixKhronosData.EnumGroup(
- "GLEnum",
- "GLEnum",
- "Glenum",
- [],
- false,
- null,
- "GL"
- )
+ new MixKhronosData.EnumGroup()
+ {
+ Name = "GLEnum",
+ NativeName = "GLenum",
+ BaseType = "GLenum",
+ Namespace = "GL",
+ }
},
},
},