I’ve got a more detailed log tonight, which I’m attaching here.
Relevant sections (I think):
02-16 01:00:12.638 14434 14473 I Unity : PreviewCamera
02-16 01:00:12.638 14434 14473 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
02-16 01:00:12.638 14434 14473 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
02-16 01:00:12.638 14434 14473 I Unity : UnityEngine.Logger:Log(LogType, Object)
02-16 01:00:12.638 14434 14473 I Unity : UnityEngine.Debug:Log(Object)
02-16 01:00:12.638 14434 14473 I Unity : MagicMarkers.MagicMarkerAbstract:OnRenderObject() (at C:\Users\Shared\gamingdev\unity\Projects\MagicMarkers-Upload\Assets\Plugins\MagicMarkers\Scripts\MagicMarkerAbstract.cs:462)
02-16 01:00:12.638 14434 14473 I Unity :
02-16 01:00:12.638 14434 14473 I Unity : (Filename: C Line: 0)
02-16 01:00:12.638 14434 14473 I Unity :
02-16 01:00:12.651 14434 14473 E Unity : The given primitive topology does not match with the topology expected by the geometry shader
02-16 01:00:12.651 14434 14473 E Unity : UnityEngine.Graphics:INTERNAL_CALL_Internal_DrawMeshNow1(Mesh, Int32, Vector3&, Quaternion&)
02-16 01:00:12.651 14434 14473 E Unity : UnityEngine.Graphics:Internal_DrawMeshNow1(Mesh, Int32, Vector3, Quaternion) (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/GraphicsBindings.gen.cs:680)
02-16 01:00:12.651 14434 14473 E Unity : UnityEngine.Graphics:smile:rawMeshNow(Mesh, Vector3, Quaternion, Int32) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Graphics.cs:400)
02-16 01:00:12.651 14434 14473 E Unity : UnityEngine.Graphics:smile:rawMeshNow(Mesh, Vector3, Quaternion) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Graphics.cs:393)
02-16 01:00:12.651 14434 14473 E Unity : MagicMarkers.MagicMarkerAbstract:smile:rawMarkerPass(Int32) (at C:\Users\Shared\gamingdev\unity\Projects\MagicMarkers-Upload\Assets\Plugins\MagicMarkers\Scripts\MagicMarkerAbstract.cs:515)
02-16 01:00:12.651 14434 14473 E Unity : MagicMarkers.MagicMarkerAbstract:smile:rawMarker() (at C:\Users\Shared\gamingdev\unity\Projects\MagicMarkers-Upload\Assets\Plugins\MagicMarkers\Scripts\MagicMarkerAbstract.cs:500)
02-16 01:00:12.651 14434 14473 E Unity : MagicMarkers.
02-16 01:00:12.666 2318 2318 D GyroRender: onSensorChanged event.sensor.getType() = 65579
02-16 01:00:12.677 14434 14473 I Unity : MapCamera
02-16 01:00:12.677 14434 14473 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
02-16 01:00:12.677 14434 14473 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
02-16 01:00:12.677 14434 14473 I Unity : UnityEngine.Logger:Log(LogType, Object)
02-16 01:00:12.677 14434 14473 I Unity : UnityEngine.Debug:Log(Object)
02-16 01:00:12.677 14434 14473 I Unity : MagicMarkers.MagicMarkerAbstract:OnRenderObject() (at C:\Users\Shared\gamingdev\unity\Projects\MagicMarkers-Upload\Assets\Plugins\MagicMarkers\Scripts\MagicMarkerAbstract.cs:462)
02-16 01:00:12.677 14434 14473 I Unity :
02-16 01:00:12.677 14434 14473 I Unity : (Filename: C Line: 0)
02-16 01:00:12.677 14434 14473 I Unity :
02-16 01:00:12.684 2318 2318 D GyroRender: onSensorChanged event.sensor.getType() = 65579
02-16 01:00:12.700 14434 14473 I Unity : Main Camera
02-16 01:00:12.700 14434 14473 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
02-16 01:00:12.700 14434 14473 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
02-16 01:00:12.700 14434 14473 I Unity : UnityEngine.Logger:Log(LogType, Object)
02-16 01:00:12.700 14434 14473 I Unity : UnityEngine.Debug:Log(Object)
02-16 01:00:12.700 14434 14473 I Unity : MagicMarkers.MagicMarkerAbstract:OnRenderObject() (at C:\Users\Shared\gamingdev\unity\Projects\MagicMarkers-Upload\Assets\Plugins\MagicMarkers\Scripts\MagicMarkerAbstract.cs:462)
02-16 01:00:12.700 14434 14473 I Unity :
02-16 01:00:12.700 14434 14473 I Unity : (Filename: C Line: 0)
02-16 01:00:12.700 14434 14473 I Unity :
((( SNIP )))
02-16 01:00:14.138 2423 2605 D EPDG -- [EPDGService]: onDataActivity: direction=0
--------- beginning of crash
02-16 01:00:14.208 14434 14473 F libc : Fatal signal 11 (SIGSEGV), code 2, fault addr 0xcf6fcff8 in tid 14473 (UnityMain)
02-16 01:00:14.210 503 503 W : debuggerd: handling request: pid=14434 uid=10242 gid=10242 tid=14473
02-16 01:00:14.326 15247 15247 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-16 01:00:14.326 15247 15247 F DEBUG : Build fingerprint: 'samsung/dreamqlteue/dreamqlteue:7.0/NRD90M/G950U1UES2AQL1:user/release-keys'
02-16 01:00:14.326 15247 15247 F DEBUG : Revision: '12'
02-16 01:00:14.326 15247 15247 F DEBUG : ABI: 'arm'
02-16 01:00:14.326 15247 15247 F DEBUG : pid: 14434, tid: 14473, name: UnityMain >>> com.j4th.MagicMarkersDemo <<<
02-16 01:00:14.327 15247 15247 F DEBUG : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xcf6fcff8
02-16 01:00:14.327 15247 15247 F DEBUG : r0 00000000 r1 00000000 r2 00000001 r3 00000000
02-16 01:00:14.327 15247 15247 F DEBUG : r4 cae8d580 r5 00000000 r6 00000000 r7 00000000
02-16 01:00:14.327 15247 15247 F DEBUG : r8 cae8d580 r9 cc056af8 sl cae8fa00 fp cae8f824
02-16 01:00:14.327 15247 15247 F DEBUG : ip 80000000 sp cf6fcfe0 lr cb3b438f pc cb39c99a cpsr 480b0030
Note the messages on lines 2, 20, and 30. The camera identification is a Debug.Log() call at the top of my OnRenderObject() method implementation.
My scene has only two cameras, “Main Camera” and “MapCamera”. That “Preview Camera” is added somehow by Unity. This is a very important clue, because my procedural objects have a camera selection mask that allows a choice of which camera(s) to include. If I specifically choose the exact cameras in my scene, everything works, but if I choose “Everything” from the mask in the inspector, then it crashes every time. I couldn’t figure out how choosing “Everything” was different from choosing all the cameras as a list. Now I know. “Everything” includes that “Preview Camera”, and that’s the one that’s crashing.
Also relevant here is the boldfaced error message about a geometry shader. My custom shader does have a geometry component, but I have two sub-shaders, one with #pragma target 4.0 and the other with #pragma target 2.5 declarations. The second sub-shader does not define any geometry component because geometry shaders require SM 4.0, so if the PreviewCamera does not support geometry shaders, it shouldn’t be using the 4.0 target sub-shader.
Now, here is where things get really interesting: I found a workaround! At the beginning of OnRenderObject(), I simply check the name of the camera against the string “PreviewCamera”, and if it matches, I return immediately with no draw attempt. My scene renders perfectly on all the other cameras, and the geometry feature of my custom shader is fully functional.
What I can’t figure out is why this is behaving differently on Android than it does on desktop. Is the “PreviewCamera” somehow connected to the UI rendering on mobile devices?
3393328–266840–AndroidErrorLog.txt (936 KB)