[ShaderGraph] [2021.2] Fix for 1383046 #6451
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.
Purpose of this PR
Fixing https://fogbugz.unity3d.com/f/cases/1383046/
This issue is already fixed in 2022.1+ via this much larger PR:
However we don't want to backport that PR.
This PR addresses just this specific issue for 2021.2.
The issue in 2021.2 is that the functions coming from this node get whitespace appended to them when they are in a subgraph, and it detects the whitespace as a different function.
I added a call to trim the whitespace from all functions before comparing them.
Testing status
Tested against repro case: colliding functions no longer collide.
Ran ShaderGraph tests locally (PC D3D11) -- success.
Yamato tests:
ShaderGraph: 🟡
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/2021.2%252Fsg%252Ffix%252F1383046/.yamato%252Fall-shadergraph.yml%2523PR_ShaderGraph_2021.2/10259680/job/pipeline
Master:
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/2021.2%252Fsg%252Ffix%252F1383046/.yamato%252Fall-shadergraph.yml%2523PR_ShaderGraph_2021.2/10266213/job/pipeline
Same jobs failing in master (Linux Vulkan & Windows DX11) -- tracked down to an upgrade from GTX gpus to RTX gpus on the test farm, changing the behavior of the sin() HLSL function, so not related to this PR.
URP: 🟢
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/2021.2%252Fsg%252Ffix%252F1383046/.yamato%252Fall-universal_split.yml%2523PR_Universal_Split_2021.2/10369086/job/pipeline
Comments to reviewers
Notes for the reviewers you have assigned.