-
-
Notifications
You must be signed in to change notification settings - Fork 444
[3.0] Implement name-related improvements identified in previous Vulkan PR #2503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Exanite
wants to merge
229
commits into
dotnet:develop/3.0
Choose a base branch
from
Exanite:feature/vulkan-bindings-3.0-improvements
base: develop/3.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[3.0] Implement name-related improvements identified in previous Vulkan PR #2503
Exanite
wants to merge
229
commits into
dotnet:develop/3.0
from
Exanite:feature/vulkan-bindings-3.0-improvements
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This looks like it's from some sort of built-in renamer. Don't think we'll ever use this since we have a custom renamer.
… work with native name attributes
Not sure why these were not being coerced when the Vulkan PR was merged, but they started getting coerced in this PR. This technically is a good thing since it means the coerce backing types code is now working as previously intended. However, the previously intended implementation missed an edge case, which this commit fixes.
This is because the structs were impossible to reasonably construct before.
VaListTagHandle is an extra handle struct that seems to generate on Linux (and not on Windows) and breaks global prefix determination.
OpenAL: ContextErrorCode seems to always be replaced with ErrorCode, even on Windows. Not sure why. This also happened during the last PR, but I didn't commit it.
…name trimmer code
Honestly, what I wrote is a complete guess, I'll likely revisit these once I understand them more.
This was referenced Jan 2, 2026
Perksey
reviewed
Jan 5, 2026
Member
Perksey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That review felt like a breeze, thanks so much for your hard work!
Command used (csharpier v0.29.2): dotnet csharpier sources/Core/Core/Annotations/NameAffixAttribute.cs && dotnet csharpier sources/Core/Core/Annotations/NativeNameAttribute.cs && dotnet csharpier sources/Core/Core/Annotations/SupportedApiProfileAttribute.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Clang/WindowsStdIncludeResolver.cs && dotnet csharpier sources/SilkTouch/SilkTouch/JobDependencies.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/AddIncludes.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/AddVTables.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/Bakery/DefaultBakeStrategy.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/Common/AttributeUtils.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/Common/ModCSharpSyntaxRewriter.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/Common/ModLoader.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/Common/ModUtils.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/ExtractNestedTyping.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/InterceptNativeFunctions.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/MarkNativeNames.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/MixKhronosData.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/PrettifyNames.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/StripAttributes.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/TransformEnums.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/TransformHandles.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/Transformation/ArrayParameterTransformer.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Mods/Transformation/FunctionTransformer.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Naming/CandidateNames.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Naming/CandidateNamesWithOriginal.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Naming/INameTrimmer.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Naming/NameTrimmer.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Naming/NameTrimmer217.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Naming/NameTrimmer218.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Naming/NameTrimmerContext.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Naming/NameUtils.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Naming/TrimmerOrder.cs && dotnet csharpier sources/SilkTouch/SilkTouch/Sources/IInputResolver.cs && dotnet csharpier tests/SilkTouch/SilkTouch/Khronos/MixKhronosDataTests.cs && dotnet csharpier tests/SilkTouch/SilkTouch/Naming/NameTests.cs
Not sure why the output is unstable, but it's fine after this second execution.
…by-my-pr [3.0] Format files I changed using CSharpier
[3.0] Reorder KhronosVendor suffixes to be last
…pdate [3.0] Update feature/name-affixes-categories with changes from develop/3.0
[3.0] Implement new name affix category approach
…vements-unrevert [3.0] Regenerate bindings on Windows for Name Improvements PR
Perksey
approved these changes
Jan 7, 2026
Member
Perksey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved once marked ready for review... lol.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of the PR
This PR focuses on implementing the naming-related improvements identified in #2457.
Depending on the scope of the tasks, some of these tasks may be pushed to another PR.
Important changes:
-HandleEXTinstead of-EXTHandle.AccelerationStructureHandleKHR-DelegateEXTinstead ofEXTDelegate.pfn struct BufferCallbackSOFTandpfn delegate BufferCallbackDelegateSOFTalGetSourcei64vDirectSOFTare now trimmed and prettified asGetSourcei64vDirectSOFTinstead ofGetSourcei64VDirectSOFT. Note the capitalization ofv. This is because affixes are added after prettification.TrimEnumMemberImpliedVendorstrims enum member vendor suffixes if it matches the enum type vendor suffix.INameTrimmer.Orderis used to order the trimmers instead of the version.List<string>?) have been made non-nullable. Most of these get allocated anyway and it makes the code more maintainable. If there is any performance issue (mainly concerning the Microsoft job), I will take the time to optimize it.NativeTypeName,NameAffix,TransformedRelated issues, Discord discussions, or proposals
Previous Vulkan PR (initial bindings generation): #2457
Discord thread: https://discord.com/channels/521092042781229087/1376331581198827520/1442651368207941643
Further Comments
Tasks not part of this PR
These are the tasks from my previous PR. These have been sorted and trimmed down to ensure that this PR remains focused. These may be added to this PR.
If you want to see the original, unmodified set of tasks, please see #2457.
These will also be part of a future PR.
SType)NativeNamefor resolving API profilesFuture PRs
TransformFunctions.Silk.NET.SDL.ConditionHandle.gen.csinstead ofConditionHandle.gen.cswhen running multiple jobs at the same time.SDL_MAX_SINT64generation on Linuxpublic const nint SDL_MAX_SINT64 = unchecked(0x7FFFFFFFFFFFFFFF);does not compileExtractNestedTypingandTransformHandlesinto a new set ofExtract-mods.ExtractNestedTyping, but forTransformHandlesit is useful forAddApiProfilesto be executed after all types are extracted, but not yet transformed.AddApiProfileswork off ofNativeNameattributes.Mat4X4case. The "X" should be lowercased.EGLasEglalSourceRewindvandalSourceRewind. ThedinRewindcan be mistaken as a data type suffix, so we add it to theEndingsNotToTrimregex. However, thedvinRewindvalso has the same problem.WordsNotToTrimIntothanEndingsNotToTrim.NativeNameattributes.StripAttributestoCleanupAttributesand adding an option in its config to optimizeNativeNameattributes.OESbeing singularizing intoOinArrayParameterTransformer.TransformArrayParameterRewriter.glFeedbackBufferxOESTransformArrayParameterRewritercan singularize the base name instead of the full name.IsProbablyABitmaskfunction based on BuildTool's IsProbablyABitmask for identifying flags enumsINameTrimmer.Order/Versionissue (we don't want magic numbers) and consider removingINameTrimmerentirely.Current Todos
Prepare to merge.
Completed Todos
Newest groups at the top. Order within a group is chronological.
Note that I also wrote a summary at the top. The summary is more comprehensive, but this section can be useful getting additional context. Also see my commit descriptions if more context is needed.
INameTrimmer.Order
INameTrimmer.INameTrimmer.Orderproperty and internalTrimmerOrderenum.Fix misc issues I noticed
VkVendorIdmembers are not trimmed properlyAttribMaskin OpenGL are not getting rewritten.fieldSymbol.ConstantValueis null, but why it is null is unclear. Maybe a Roslyn bug? Example member:DepthBufferBit = unchecked((uint)0x00000100). Note that similar expressions in Vulkan are fine, eg:unchecked((ulong)0x00000002UL). Maybe it is because the literal type and cast type are different.ParseTypeName(baseType)instead ofIdentifierName(baseType).Fix issues introduced by name affix system
MixKhronosDatacode removals to the currentdevelop/3.0branch and see what changes would be made. This is to ensure I don't accidentally remove functionality when deleting code.Name affix system
PFNVkDebugUtilsMessengerCallbackEXTandBufferTHandlePFNVkDebugUtilsMessengerCallbackEXTprefixPFNVkDebugUtilsMessengerCallbackDelegateEXTsuffixAccelerationStructureHandleKHRsuffixNameSuffixattributes.HandleEXTinstead ofEXTHandlefor readability.Name metadata
GLEnumand the other OpenGL enumsName prettification
Change naming convention to not capitalize acronyms (i.e., strictly pascal cased)See: https://discord.com/channels/521092042781229087/1376331581198827520/1395097379329282089Update generated method class names in the rsp files to be strictly pascal caseStdVideoEncodeH264SliceHeaderFlagsproperty names. They currently aren't getting prettified.Fix bugs from original PR
Handle struct improvements