[ShaderGraph] [BugFix 1271618] fix SampleVirtualTextureNode output slots (when toggling AutoStream) #1717
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
Fixes https://fogbugz.unity3d.com/f/cases/1271618/
When toggling automatic streaming, the SampleVirtualTexture node refreshes it's slots.
Previously it did so using the UpdateNodeAfterDeserialization() which does not check the connected property to find the correct number of slots, so it displays all four slots by default. However, if there are fewer than four slots configured, the extra output slots will not work and will cause errors if the user connects to them.
The fix here is to directly call RebuildAllSlots(true), so that it looks at the vtProperty when determining the number of slots.
This is exactly equivalent to the old behavior of UpdateNodeAfterDeserialization(), except it passes true instead of false.
Testing status
Manual Tests: What did you do?
Tested in local windows editor against repro case.
Yamato: (Select your branch):
https://yamato.prd.cds.internal.unity3d.com/jobs/902-Graphics
Any test projects to go with this to help reviewers?
Comments to reviewers
Notes for the reviewers you have assigned.