-
Notifications
You must be signed in to change notification settings - Fork 195
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
Handle case insensitive FXC HLSL keywords. #2347
Merged
teoxoy
merged 3 commits into
gfx-rs:master
from
PJB3005:23-05-18-case-insensitive-keyword
May 31, 2023
Merged
Handle case insensitive FXC HLSL keywords. #2347
teoxoy
merged 3 commits into
gfx-rs:master
from
PJB3005:23-05-18-case-insensitive-keyword
May 31, 2023
Conversation
This file contains 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
PJB3005
force-pushed
the
23-05-18-case-insensitive-keyword
branch
2 times, most recently
from
May 18, 2023 15:11
b51a3b9
to
4e6480d
Compare
There are a few keywords like "pass" in HLSL that are actually case-insensitive for FXC. This can be disabled with strict mode, but even if you do that FXC will continue to give an error if you try to use them in identifiers (at all, with any casing). This changes the namer code to escape these keywords even if the casing is different. If you're wondering where I got the list from: I looked at the list of strings in D3DCompiler_47.dll.
PJB3005
force-pushed
the
23-05-18-case-insensitive-keyword
branch
from
May 18, 2023 15:28
4e6480d
to
30471e4
Compare
We do need FXC support for the time being. |
jimblandy
added
kind: bug
Something isn't working
area: back-end
Outputs of shader conversion
lang: HLSL
High-Level Shading Language
labels
May 22, 2023
teoxoy
requested changes
May 25, 2023
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.
Thanks for the PR! I double checked FXC's behavior and this seems needed for the time being.
Remove dependency on unicase Remove duplicate TextureCube keyword
PJB3005
force-pushed
the
23-05-18-case-insensitive-keyword
branch
from
May 26, 2023 20:29
8935654
to
8265509
Compare
teoxoy
reviewed
May 30, 2023
teoxoy
approved these changes
May 31, 2023
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.
LGTM, thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: back-end
Outputs of shader conversion
kind: bug
Something isn't working
lang: HLSL
High-Level Shading Language
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.
Honestly I realized while almost done with this that maybe trying to put maintenance effort into FXC rather than DXC wouldn't be worth it, but OH WELL. Feel free to deny this PR if we don't want to add bugfixes for FXC.
There are a few keywords like "pass" in HLSL that are actually case-insensitive for FXC. This can be disabled with strict mode, but even if you do that FXC will continue to give an error if you try to use them in identifiers (at all, with any casing).
This changes the namer code to escape these keywords even if the casing is different.
If you're wondering where I got the list from: I looked at the list of strings in D3DCompiler_47.dll. None of this is documented.