Rename uv
to uv_a
and VERTEX_UVS
to VERTEX_UVS_A
in shaders.
#10237
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.
Objective
We now support two sets of UVs, so
uv
andVERTEX_UVS
in shaders are now ambiguous.Solution
To solve this, we explicitly mark the UV set we're using in the shaders, so as to distinguish it from the second UV set used for lightmaps in PR #10231.
The obvious question is "why use
UV_A
andUV_B
instead of UV0 and UV1?" The answer is that Naga doesn't currently allow preprocessor definitions that end in numbers. To work around this restriction, I renamed UV0 toUV_A
and UV1 toUV_B
.Changelog
Changed
uv
field is nowuv_a
, and the corresponding define changed fromVERTEX_UVS
toVERTEX_UVS_A
, for clarity when multiple UV sets are involved.Migration Guide
uv
field of the vertex input or output in a custom shaders, change it touv_a
. Likewise, the corresponding define should be changed fromVERTEX_UVS
toVERTEX_UVS_A
.