Immediate mode broken in iOS

Avatar
  • updated

Image 548

Blank Unity 2020.3.24 URP project created from the HUB. 

Import shapes. 

Rebuild for URP etc. and allow shapes to regenerate what it asks for. 

Open FPS scene in game view. Observe it working. 

Build for ios and open on device. Observe it NOT WORKING. 

See Screenshot. 

Reporting a bug? please specify Unity version:
2020.3.24
Reporting a bug? please specify Shapes version:
4.1.1
Reporting a bug? please specify Render Pipeline:
URP
Avatar
Freya Holmér creator

Could you try following the instructions in this thread? I've listed a few things to try resolve this issue

Avatar
b toqq

I added that to Awake() in the FPSController. Here's the output running on the iphone 13 pro:

2022-01-17 19:37:23.351455+0100 shapetest[2824:1148351] Built from '2020.3/staging' branch, Version '2020.3.24f1 (79c78de19888)', Build type 'Release', Scripting Backend 'il2cpp'
2022-01-17 19:37:23.351947+0100 shapetest[2824:1148351] MemoryManager: Using 'Default' Allocator.
-> applicationDidFinishLaunching()
2022-01-17 19:37:23.607893+0100 shapetest[2824:1148351] fopen failed for data file: errno = 2 (No such file or directory)
2022-01-17 19:37:23.607938+0100 shapetest[2824:1148351] Errors found! Invalidating cache...
-> applicationDidBecomeActive()
[Subsystems] Discovering subsystems at path /private/var/containers/Bundle/Application/F31219F9-8849-41D9-8F7C-0864EA2D942B/shapetest.app/Data/UnitySubsystems
GfxDevice: creating device client; threaded=1
Initializing Metal device caps: Apple A15 GPU
Initialize engine version: 2020.3.24f1 (79c78de19888)
2022-01-17 19:37:23.846439+0100 shapetest[2824:1148683] fopen failed for data file: errno = 2 (No such file or directory)
2022-01-17 19:37:23.846470+0100 shapetest[2824:1148683] Errors found! Invalidating cache...
2022-01-17 19:37:24.030700+0100 shapetest[2824:1148351] Unbalanced calls to begin/end appearance transitions for .
2022-01-17 19:37:24.030893+0100 shapetest[2824:1148351] Unbalanced calls to begin/end appearance transitions for .
UnloadTime: 3.050042 ms
SystemInfo.supportsInstancing=True

Shapes.FpsController:Awake()

Avatar
Freya Holmér creator

can you check to make sure that your target platform supports GPU instancing?
Unity has a function for it here, that you can run on your target platform:
https://docs.unity3d.com/ScriptReference/SystemInfo-supportsInstancing.html

Avatar
b toqq

I can confirm that both my game and the FPS HUD example work correctly with GPU instancing off. There are no errors or warnings on the debug log on the device in either case.

Avatar
Freya Holmér creator

a few things to check:

  • is GPU instancing working on the device? Unity has helper functions to check hardware support
    • If you disable immediate mode GPU instancing in the Shapes settings window, does it start working? if so then somehow GPU instancing doesn't work on your device (which could be either Unity's or my fault, hard to tell)
  • Are there any shader warnings or errors related to Shapes that pop up in the build logs or editor logs?

Avatar
b toqq

 Yes the import does indeed break, but that is easily fixable by restarting Unity and regenerating the shaders etc from the Shapes settings.

This issue with lines not showing up on iOS is something I found in my game, and while trying to isolate it I essentially got down to the FPS demo in terms of complexity.

Then I figured I'll just test the FPS demo as-is with zero modifications, and as you see, that does not work.

Hopefully that is an easy repro case for you!

Also note that there are no errors from the device itself, the shapes shaders are compiled without issues, but I can't see anything being obviously wrong.

Avatar
Freya Holmér creator

have you tried restarting Unity? sometimes the first time import breaks