Skip to content

Conversation

cdxntchou
Copy link

@cdxntchou cdxntchou commented Aug 25, 2021

Purpose of this PR

Fixing an issue I ran into, where sometimes the subgraph asset is destroyed, and we don't remove it from the cached list before attempting to access it. This PR just adds a check to ignore the cache entry if it has been destroyed.

As far as I can tell, this is triggered when I have a package mapped to a repo, that contains a subgraph, and I sync the repo (with a subgraph asset deletion) while Unity is running. ShaderGraph seems to run this code before the removing the deleted asset from the list, resulting in an exception being thrown when the asset is accessed -- the exception borks ShaderGraph, making it unoperational.


Testing status

Tested against the repro steps above (changing package version). The PR fixes the issue.

Yamato:
ShaderGraph PR Job: https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/sg%252Ffix%252Fsearch-window-exception/.yamato%252Fall-shadergraph.yml%2523PR_ShaderGraph_2021.2/8407608/job


Comments to reviewers

Notes for the reviewers you have assigned.

@github-actions
Copy link

Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed.
Link to Yamato: https://yamato.cds.internal.unity3d.com/jobs/902-Graphics
Search for your PR branch using the sidebar on the left, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

Shader Graph
/.yamato%252Fall-shadergraph.yml%2523PR_ShaderGraph_2021.2
Depending on your PR, you may also want
/.yamato%252Fall-shadergraph_builtin_foundation.yml%2523PR_ShaderGraph_BuiltIn_Foundation_2021.2
/.yamato%252Fall-shadergraph_builtin_lighting.yml%2523PR_ShaderGraph_BuiltIn_Lighting_2021.2

Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure.

@cdxntchou cdxntchou marked this pull request as ready for review August 27, 2021 18:25
@cdxntchou cdxntchou requested a review from a team as a code owner August 27, 2021 18:25
Copy link
Contributor

@jessebarker jessebarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cdxntchou cdxntchou merged commit 34fd989 into master Aug 31, 2021
@cdxntchou cdxntchou deleted the sg/fix/search-window-exception branch August 31, 2021 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants