@thep3000 I updated the visionos_config.h and that gave me a new crash. After that I rebuilt the project from Unity using the Device Target setting and still got the same new crash.
We haven’t prioritized looking into this yet at we were mainly focused on device - but disabling validation seems to get things working on simulator (not necessary on device). We have seen another crash related to mip uploads on simulator so you may run into that but it seems to only happen sometimes. (don’t know of a workaround for that one, yet… seems to be related to the simulator implementation of astc texture decoding, some sort of race condition … you can maybe try not using astc textures if you see it)
@thep3000 Turning off Metal API validation does allow my empty VR test project to work in the simulator. Unfortunately, my port project hits the mip upload crash bug.
@thep3000 Confirmed that ASTC compression is being used in this project. Is the default compression of visionOS ASTC then? I thought importing it for the visionOS platform would have changed that to something else. ASTC does make sense for the project as that is what I used for the Quest/Quest 2 release.
I am hesitant to change the texture compression for everything in the project just to be able to run it in the Simulator.
Would there be a fix on the Unity side? Should I report a bug somewhere for Unity or does this need to go to Apple?
I just tested my empty Unity project setup with an ASTC compressed texture added to the project and rendered on a quad. With this change the project still runs in the Simulator without issue. I’ll continue to test image setting tweaks to see if I can find the mip issue.
I just tested my empty Unity project setup with an ASTC compressed texture added to the project and rendered on a quad. With this change the project still runs in the Simulator without issue. I’ll continue to test image setting tweaks to see if I can find the mip issue.
It’s a race condition, we think within the apple simulator’s astc decompression logic. Only happens on more complex scenes.
Would there be a fix on the Unity side? Should I report a bug somewhere for Unity or does this need to go to Apple?
We have a workaround on the Unity side - it’s going through verification now and will be in a future 2022.3 release. We might be able to get you a fix out of band, I’ll check into it. We’re also going to bring it up to apple - but from what I can see this has been around for a while - we had apparently had reports of the same issue on tvOS simulator years ago.
Here’s a 2022.3.5f1 patched build of the VisionOSPlayer fixing the ASTC texture issue.
You’ll need to replace the VisionOSPlayer in your unity install with the folder in this zip. By default w/ hub, here: /Applications/Unity/Hub/Editor/2022.3.5f1/PlaybackEngines/VisionOSPlayer
There is a native dylib that you’ll need to remove quarantine flag on : xattr -d com.apple.quarantine VisionOSPlayer/arm64/UnityEditor.VisionOS.Native.dylib
I got my VR port project issues fixed up and now when I run against the Simulator I can hear the game sounds but it only renders black. Are there any specific gotchas I should check that might be causing this?
You should be able to attach unity’s Frame Debugger and get a better picture of what’s going on. The textures that end up going to the screen are named XR Texture [#], so see what they look like.
On device, the usual suspect for rendering black is depth not being written to or written to as zero. But the simulator seems to ignore that so I don’t think it would be depth related.
@thep3000 Please ignore this. It was a project issue that I missed; I failed to update our screen fader to work for visionOS so it happily rendered overtop of everything with full black. Thanks for all of the help!