Search Unity

Bug DrawMeshInstancedIndirect not working on specific GPUs (Mali) - 2019.4.36f1

Discussion in 'General Graphics' started by Kmess, Feb 24, 2022.

  1. Kmess

    Kmess

    Joined:
    Dec 21, 2013
    Posts:
    11
    For our game we're seeing issues with DrawMeshInstancedIndirect not working on specific GPUs - mainly OpenGLES3. We had two devices - Galaxy S21 - two model numbers.

    SM-G991B/DS - doesn't work - only one instance gets rendered, it seems like the positions aren't translating, it has a GPU of Mali-G78 MP14
    SM-G991U - it has a GPU of Adreno 660. This device along with many other android devices that support OpenGLES3.0 works just fine (Pixel 3a, Pixel4, and more)

    We have confirmed the same behavior on this sample project here (build an apk from it to reproduce it): https://github.com/Bagoum/Unity-DrawMeshInstancedIndirect

    We also have built an apk, located here: https://drive.google.com/file/d/1TbSN8MuaoaiElDoVUwfCfcrz__1g11QO/view

    On devices that work fine, you should see multiple F's with different positions and rotations, on devices that don't work correctly, you will only see one F (this is assuming that there are many F's but all are drawn in same position / rotation).

    We are using Unity 2019.4.36f1 (latest LTS) - I was hoping that this would fix it (fixed in 2019.4.36f1) - https://issuetracker.unity3d.com/is...d-vector3-nodes-that-control-objects-position but it still reproduces on that specific Mali GPU

    Graphics API is set to OpenGLES3 for this scenario

    Any help or direction would be greatly appreciated.
     
    Last edited: Feb 24, 2022
    fiveampsoftware likes this.
  2. Kmess

    Kmess

    Joined:
    Dec 21, 2013
    Posts:
    11
    Bump - anyone else sees this or from anyone at Unity chime in?
     
  3. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    1. Mali sucks.
    2. It is probably because you are trying to use a Structured buffer in the vertex shader. I think most or all Mali GPUs do not support this on GL ES. Although many of them do support it on Vulkan. You can check though here : https://docs.unity3d.com/ScriptReference/SystemInfo-maxComputeBufferInputsVertex.html If that returns 0 on your device, it means it isn't supported, at least on that graphics API.

    Your other option is to instead write the values you need to a render texture instead of a compute buffer. The vertex shader should support at least reading values from there.
     
    bbsuuo and richardkettlewell like this.
  4. tommox86

    tommox86

    Joined:
    Apr 30, 2015
    Posts:
    88
    for mali gpu did you confirm its working with vulkan api?
     
  5. Kmess

    Kmess

    Joined:
    Dec 21, 2013
    Posts:
    11
    it did work with the vulkan api but wasn't the ideal situation. We ended up scrapping DMII approach and relied on dynamic batching instead (made smaller textures and smaller meshes)
     
    tommox86 likes this.