2021.2/hybrid switch underscore fix #5679
Merged
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.
Prior to this PR, Hybrid Renderer shader constants used a naming format which frequently results in double underscores being present in the constant names, which unfortunately triggers warnings on the Nintendo Switch platform and causes massive log spam and slowdowns when shaders are compiled.
This PR alters the DOTS instancing property definitions in the Graphics package to remove underscores from the names, which prevents a double underscore from happening whenever there's a variable name that starts with an underscore (very common in Unity).
Using this PR requires a version of Unity that supports the underscoreless format. A PR will be landed in 2021.2 to support this. An unsupported Unity version cannot run the Hybrid Renderer, but GameObject rendering should be completely unaffected regardless of the versions, as the change should only affect Hybrid Renderer shader variants.
Checklist for PR maker
need-backport-*
label. After you backport the PR, the label changes tobackported-*
.CHANGELOG.md
file.Purpose of this PR
Why is this PR needed, what hard problem is it solving/fixing?
Testing status
Describe what manual/automated tests were performed for this PR
Comments to reviewers
Notes for the reviewers you have assigned.