HLSL: Uses UserSemantic decoration to generate vertex input and output semantics #2579
+134
−31
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.
Related issues: #1687 #2461
This PR adds an optional flag
--hlsl-user-semanticwhich will process Decoration UserSemantic to generate HLSL semantic names.I set it off by default, but let me know if you think this should be on by default.
It only happens when SPIR-V has UserSemantic, so my opinion would be to simply remove the parameter and set it on by default.
If Decoration UserSemantic is not specified for some variables/struct members, it will fallback to the default mechanism (either
add_vertex_attribute_remaporTEXCOORD#).I still need to run a few more tests to check all situations are working as intended
(I only tested it with top-level variables, not with a struct with its member having semantic, but it should work).