Skip to content
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

Fix Shader Errors Caused By Typo in EditorShaderVariables.hlsl #7951

Conversation

aSimpleUsername
Copy link

@aSimpleUsername aSimpleUsername commented Aug 25, 2023


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.

Obviously the white space on line 2 shouldn't be there.
This was giving me undeclared identifier errors, and fixing this locally resolved this issue.​
@aSimpleUsername aSimpleUsername changed the title Update EditorShaderVariables.hlsl Fix Shader Errors Caused By Typo in EditorShaderVariables.hlsl Aug 25, 2023
@sebastienlagarde
Copy link
Contributor

sebastienlagarde commented Sep 4, 2023

Hi, thanks for notifiying us on this mistake, could I ask in which context you are getting an error? Which platform / configuration are you trying to compile? We don't expect this file to be used at runtime
thanks a lot

@bmourit
Copy link

bmourit commented Sep 4, 2023

While fixing this, why not correct:
EDITOR_SHADER_VARAIBLES -> EDITOR_SHADER_VARIABLES

@aSimpleUsername
Copy link
Author

Hi, thanks for notifiying us on this mistake, could I ask in which context you are getting an error? Which platform / configuration are you trying to compile? We don't expect this file to be used at runtime thanks a lot

Hi, no worries, Windows 64bit - The error shows when building, not runtime

@sebastienlagarde
Copy link
Contributor

While fixing this, why not correct: EDITOR_SHADER_VARAIBLES -> EDITOR_SHADER_VARIABLES

yes, fixed this at the same time that I integrated the correction in our private repo. I ,also fixed the custom texture for shader graph

@sebastienlagarde
Copy link
Contributor

Closing this PR, it have landed on private repo in this PR: https://github.cds.internal.unity3d.com/unity/unity/pull/35555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants