Skip to content

[9.x.x] Improved EditorResourceAsset loading and shader nullreference exceptions #236

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

Merged
merged 2 commits into from
Apr 27, 2020

Conversation

ellioman
Copy link
Contributor

@ellioman ellioman commented Apr 23, 2020

Purpose of this PR

This PR solves two issues:

  • Performance issues when opening a big project in URP due to a call to AssetDatabase.FindAssets(). It is now replaced with a LoadAssetAtPath using the asset's GUID.
  • NullReferenceExceptions when trying to load several shaders when building a project in URP. We now do the same as HDRP, which is to return null if the editor resource is not available.

Checklist for PR maker

  • Have you added a backport label (if needed)? For example, the need-backport-* label. After you backport the PR, the label changes to backported-*.
  • Have you updated the changelog? Each package has a CHANGELOG.md file.
  • Have you updated or added the documentation for your PR? When you add a new feature, change a property name, or change the behavior of a feature, it's best practice to include related documentation changes in the same PR.
  • Have you added a graphic test for your PR (if needed)? When you add a new feature, or discover a bug that tests don't cover, please add a graphic test.

Testing status

Manual Tests:

  • Opened test project + Run graphic tests locally
  • Built a player
  • Checked new UI names with UX convention
  • Tested UI multi-edition + Undo/Redo + Prefab overrides + Alignment in Preset
  • C# and shader warnings (supress shader cache to see them)
  • Checked new resources path for the reloader (in developer mode, you have a button at end of resources that check the paths)
  • Other:

Automated Tests:
Added a check in the ValidateBuiltinResourceFiles test where we now also test that the editor resource asset is loaded.

Yamato:
https://yamato.prd.cds.internal.unity3d.com/jobs/902-Graphics/tree/universal%252Feditorresource-and-speedtree-fixes

Copy link
Contributor

@erikabar erikabar left a comment

Choose a reason for hiding this comment

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

Tested Boat Attack models, also grabbed more models from the Asset Store - everything is now importing faster. NullReferenceExceptions are gone.

@phi-lira phi-lira merged commit 833aba6 into master Apr 27, 2020
@phi-lira phi-lira deleted the universal/editorresource-and-speedtree-fixes branch April 27, 2020 10:07
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