Skip to content
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

[msl-out] Make varyings' struct members unique #2521

Merged
merged 4 commits into from
Sep 29, 2023
Merged

Conversation

evahop
Copy link
Contributor

@evahop evahop commented Sep 28, 2023

Fixes #1490

Naming conflicts can occur when multiple structs get flattened into one varyings struct.
This moves the namer.call invocation into the flattening routine so that each member gets a unique name.

Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! It looks good but could you add a test for this? The one in the issue would work.

@evahop
Copy link
Contributor Author

evahop commented Sep 28, 2023

Yes, I was going to add that there's also a namer.namespace method specifically for structs, It may be more appropriate, but I am not familiar enough with result types. I will try to use that instead, but no promises. I didn’t bother with it initially because I wasn’t sure if I’d be able to access those new names anyhow.

@evahop
Copy link
Contributor Author

evahop commented Sep 28, 2023

Added the snapshot, which also confirms #1464 has been fixed (not by me).
Abandoned namer.namespace and ended up just adding a new namer solely for the locations.

src/back/msl/writer.rs Outdated Show resolved Hide resolved
@teoxoy
Copy link
Member

teoxoy commented Sep 29, 2023

Seems like #1464 was fixed by #1766.

Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Good stuff!

@teoxoy teoxoy merged commit 9f3cdb6 into gfx-rs:master Sep 29, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[metal-out] Duplicate member in input structs
2 participants