Search Unity

Dynamic batching causes my app to crash?

Discussion in 'iOS and tvOS' started by Darkcoder, Feb 11, 2012.

  1. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,412
    I couldn't find much info on this when searching, but this Unity Answers thread seems to be identical to the issue I'm having.

    Basically, in my game I have a prefab that when spawned a certain amount of times, the app crashes.

    Here's the /Assets folder for my test project. The error occurs when the material has my shader applied, you have dynamic batching enabled, and you tap the button to spawn many prefabs.

    If you use the 'FeX/Unlit' shader, then you can spawn 127 instances before it crashes.
    If you use the 'FeX/UnlitWithNormal' shader, then you can spawn 63 instances before it crashes.
    If you use the 'FeX/UnlitWithNormalAndTangent' shader then it doesn't crash? I went past 200 without issues.

    The 2nd shader has twice the input vertex format size compared to the first, and the crash occurs twice as fast, so I presume the issue has to do with copying data into the vertex buffer. Though I'm not sure why the 3rd shader works fine.


    The stack trace is:

    0 TransformVertices_Strided_XYZN_0_Loop
    1 TransformStrided [inlined]
    2 TransformSubmeshToWorldSpace(blah blah)

    I'm running Unity 3.4.2f3, under OpenGL ES 2.0

    Has anyone else experienced this issue?
     
    Last edited: Feb 11, 2012
  2. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Is your problem still reproducible with Unity 3.5 public beta? If yes - please submit a bug report with repro project attached to it.
    Thanks!