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

Refactor namer scheme, fix trailing digits #1510

Merged
merged 1 commit into from
Nov 9, 2021
Merged

Conversation

kvark
Copy link
Member

@kvark kvark commented Nov 3, 2021

Fixes #1508

@kvark kvark requested a review from jimblandy November 3, 2021 18:08
Copy link
Member

@jimblandy jimblandy left a comment

Choose a reason for hiding this comment

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

At present, namer.call("!@#$") and namer.call("") both return "" the first time. We should check for an empty sanitized string. Then we can drop the check in call_or.

It took me a while, but I eventually convinced myself that this will always produce distinct names. I don't object to landing this (with the above fixed), but I think it would be much simpler if we just ensured that sanitize never returns anything ending in _N. Then we can simply say, self.unique never contains anything ending in _N, so either we just added the string, or we added a novel numeric suffix.

src/proc/namer.rs Show resolved Hide resolved
src/proc/namer.rs Show resolved Hide resolved
@kvark kvark merged commit 8bc3aa8 into gfx-rs:master Nov 9, 2021
@kvark kvark deleted the namer branch November 9, 2021 14:24
@kvark kvark added the can backport PR that can be back-ported to a release branch label Nov 9, 2021
kvark added a commit to kvark/naga that referenced this pull request Dec 2, 2021
@kvark kvark mentioned this pull request Dec 2, 2021
@kvark kvark removed the can backport PR that can be back-ported to a release branch label Dec 2, 2021
kvark added a commit that referenced this pull request Dec 2, 2021
@kvark
Copy link
Member Author

kvark commented Dec 2, 2021

Published in 0.7.2

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.

water example triggers shader compiler error
2 participants