ShaderGraph load hangs process

I seem to have run into an issue loading any ShaderGraph in the simulator – the process hangs with the call stack shown below the first time any custom shader graph is used. This started happening several hours ago and is affecting all of my projects, and all shader graphs:

image

Things I have tried:

  • Two unrelated Unity projects; after one started hanging, the other did too.
  • Simplifying the shader graphs (I’m now testing ones that were definitely working earlier today, as I was verifying a fix in 0.3.2).
  • Clean build folder
  • Clean shader graph cache and reimport
  • Restart Mac
  • Looked in Xcode console and Console app for errors, nothing is apparently related that I can see

If the project does not use a shader graph, it runs fine; and if it uses one after a few seconds, then the process only hangs the first time the shader graph is rendered.

Any suggestions for other cache folders etc to try cleaning?

Thank you!

Hello! Would it be possible to submit a report for this? The root cause is that we used to use a blocking version of ShaderGraphMaterial.init that no longer exists in visionOS beta 3, so we switched to blocking the main thread on a DispatchSemaphore while waiting for the async load to complete. However, the shader graph load requires dispatch on the main thread, so we ended up having to call RunLoop.current.run in order to do main thread dispatch while waiting on the semaphore. That’s where the crash is happening–in that main event dispatch.

The above was a stopgap measure to avoid having to handle actual asynchronous shader graph loading in PolySpatial, but we have a better solution now and could prioritize pushing it out in the next bugfix release.

Thanks for the explanation! I’ve submitted IN-55591 which also includes a core dump.

Would it be possible for you to send me a build that includes the bugfix in the interim? I’m currently completely blocked on all development unless I strip out all shader graphs and replace them with builtin materials. (I’ll also continue looking for cache directories to clear out, since this obviously is only affecting me and only after one point in time, I assume there’s something local on my machine that needs to be exorcised).

Following advice from https://discussions.unity.com/t/visionos-beta-release-notes-0-3/294722/8 to launch the app from the Home Screen instead of Xcode seems to workaround the issue around 50% of the time for me. This makes me think it’s purely a race condition and not related to any disk cache. Would definitely appreciate a quick turnaround on that bug fix :slight_smile:

Thanks for the report; I will check that out today. Unfortunately, I don’t think I can provide a custom build outside of the normal release process, but I will try to push for a bugfix release ASAP.

Sorry about the delay! The 0.3.3 bugfix release that we released yesterday should address this issue.