Skip to content

Conversation

ellioman
Copy link
Contributor

@ellioman ellioman commented Nov 8, 2021

Purpose of this PR

Fixing issue 1374215

When opening up a project with a clean library, the SSAO shader would throw an error if Async Shader Compilation was enabled. This was happening because the Renderer Feature is trying to draw while shader was compiling.

The solution is to disable asynchronous shader compilation for the SSAO shader.

@ellioman ellioman requested review from a team as code owners November 8, 2021 12:38
@github-actions
Copy link

github-actions bot commented Nov 8, 2021

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://unity-ci.cds.internal.unity3d.com/project/902/
Search for your PR branch using the search bar at the top, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

URP
/jobDefinition/.yamato%252Fall-urp.yml%2523PR_URP_trunk
With changes to URP packages, you should also run
/jobDefinition/.yamato%2Fall-lightmapping.yml%23PR_Lightmapping_trunk

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.

@github-actions
Copy link

github-actions bot commented Nov 8, 2021

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page).
See the PR template for more information.
Thank you!

@gmitrano-unity
Copy link
Contributor

I've seen similar errors in the console when turning on SMAA for the first time in a project while the game view is open. Is this happening because the "stand-in" loading material only has a pass 0? If that's the case, I'd expect all draws with the loading material which target passes other than pass 0 to fail. Should the engine just disable async editor compilation for any shader with multiple passes?

Copy link
Contributor

@Jonasmortensen Jonasmortensen left a comment

Choose a reason for hiding this comment

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

Tested on package sample import and issue is fixed 👍

@ellioman
Copy link
Contributor Author

ellioman commented Nov 9, 2021

@gmitrano-unity

I've seen similar errors in the console when turning on SMAA for the first time in a project while the game view is open.

I tried reproducing that error but was unable to. If you can give me a repro, please let me know.

Is this happening because the "stand-in" loading material only has a pass 0?

Yes, the loading shader has only one pass and SSAO was trying to call the 4 passes it needs while compiling.

If that's the case, I'd expect all draws with the loading material which target passes other than pass 0 to fail. Should the engine just disable async editor compilation for any shader with multiple passes?

I don't think such a blanket thing would work. But we need to be careful with features that have multiple shader passes that need compiling because of variants etc. We're already doing this with the Blit shaders and the ShadowMidtonesHighlights.

@phi-lira
Copy link
Contributor

Approving this PR, without much context this seems a problem that might bite us back in the future. It seems something that could be improved on the asynchronous shader compilation.

@phi-lira phi-lira changed the base branch from master to universal/staging November 10, 2021 09:27
@phi-lira phi-lira merged commit 82019ee into universal/staging Nov 10, 2021
@phi-lira phi-lira deleted the universal/bugfix-1374215 branch November 10, 2021 09:28
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.

4 participants