Skip to content

Commit

Permalink
Fix ToString change being applied to wrong structs
Browse files Browse the repository at this point in the history
  • Loading branch information
Perksey committed Oct 31, 2024
1 parent e4191ca commit b377db8
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/Core/Silk.NET.BuildTools/Converters/Readers/VulkanReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,6 @@ IReadOnlyList<Struct> GetAllAliasesFromName(string? api, string structName)
continue;
}

var toString = new Function
{
Accessibility = Accessibility.Public,
IsOverride = true,
ReturnType = new Type { Name = "string" },
Name = "ToString"
};

var @struct = new Struct
{
Fields = s.Members.Select
Expand Down Expand Up @@ -188,10 +180,6 @@ IReadOnlyList<Struct> GetAllAliasesFromName(string? api, string structName)
}.WithFixedFieldFixup09072020()
)
.ToList(),
Functions = new List<ImplementedFunction>
{
new(toString, new StringBuilder("return Handle.ToString();"), toString, false)
},
Name = Naming.TranslateLite(TrimName(s.Name, task), prefix),
NativeName = s.Name,
ProfileName = s.Api
Expand Down Expand Up @@ -348,6 +336,19 @@ IReadOnlyList<Struct> GetAllAliasesFromName(string? api, string structName)
}
}

var toString = new Function
{
Accessibility = Accessibility.Public,
IsOverride = true,
ReturnType = new Type { Name = "string" },
Name = "ToString"
};

var handleFuns = new List<ImplementedFunction>
{
new(toString, new StringBuilder("return Handle.ToString();"), toString, false)
};

foreach (var h in spec.Handles)
{
ret.Add
Expand All @@ -359,7 +360,8 @@ IReadOnlyList<Struct> GetAllAliasesFromName(string? api, string structName)
new Field {Name = "Handle", Type = new Type {Name = h.CanBeDispatched ? "nint" : "ulong"}}
},
Name = Naming.TranslateLite(TrimName(h.Name, task), prefix),
NativeName = h.Name
NativeName = h.Name,
Functions = handleFuns
}
);
}
Expand Down

0 comments on commit b377db8

Please sign in to comment.