Thanks to visit codestin.com
Credit goes to github.com

Skip to content

#2298 override ToString() method for vulkan objects #2323

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

Closed
wants to merge 2 commits into from

Conversation

tonisimakov99
Copy link

@tonisimakov99 tonisimakov99 commented Oct 31, 2024

Summary of the PR

Adds an override of the ToString() method to structures to output the Handle field

Related issues, Discord discussions, or proposals

Issue 2298

Further Comments

@tonisimakov99 tonisimakov99 marked this pull request as ready for review October 31, 2024 18:22
@tonisimakov99 tonisimakov99 requested a review from a team as a code owner October 31, 2024 18:22
@tonisimakov99 tonisimakov99 changed the title start of #2298 override ToString() method for vulkan objects #2298 override ToString() method for vulkan objects Oct 31, 2024
Copy link
Member

@Perksey Perksey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks so much for contributing to Silk.NET! And more notably, for trying to get stuck in to BuildTools - it's a rather complicated beast, and I always welcome anyone wanting to brave a change in there.

I actually swept this up around the same time as you submitted this PR in #2184, and I think I'll have that supersede this PR if that's okay with you? :) Feel free to see what I implemented over there re the comment below

Copy link
Member

@Perksey Perksey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't meant to press submit!

@@ -503,6 +503,16 @@ public static void WriteStruct
sw.WriteLine();
}

var handleField = @struct.Fields.FirstOrDefault(t => t.Name == "Handle" && t.Type.Name == "ulong");
Copy link
Member

@Perksey Perksey Oct 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot, but this isn't quite the right place to put it as this will generate for every structure (including those that don't have a Handle field). What I decided to do in my PR is handle this in the VulkanReader i.e. right at the source of the generation of those Handle fields. But something at this layer would've worked too with a check for a structure being handle-like! Many ways to skin a cat :)

@Perksey Perksey closed this Oct 31, 2024
@tonisimakov99 tonisimakov99 deleted the to-string-override branch October 31, 2024 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants