Fix Shader Errors Caused By Typo in EditorShaderVariables.hlsl #7951
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.
Purpose of this PR
This PR was originally just to fix the obvious whitespace on line 2 that has somehow gone unnoticed
Turns out this didn't completely fix the 'undeclared identifier' shader errors I was getting when we building, so I've added the definitions into this file. I believe this is what was intended by the Unity developers.
If you look at when EditorShaderVariables.hlsl was created they removed the legacy variables out of ShaderVariables.hlsl and put them in EditorShaderVariables, but excluded the ones I'm adding in this change - and they didn't add them anywhere else.
I also simplified the else statement, because the way they've written it is redundant.
Just as a note: The ShaderGraph ShaderVariables still contain all these definitions.
Testing status
Fixing this locally resolved this issue.
Comments to reviewers
Notes for the reviewers you have assigned.