Search Unity

Compute Shader does not work on Arm64 (but works on Armv7)

Discussion in 'Android' started by talofen, Oct 18, 2019.

  1. talofen

    talofen

    Joined:
    Jan 1, 2019
    Posts:
    40
    I am porting my project from Windows to Android. It has a (fairly complex) Compute Shader. I'm using Vulkan.
    I followed the suggestions on the Manual (checked that there are no out of bounds reads/writes and stored buffer sizes in variables).

    If I build it targeting Armv7, it works flawlessly. If I target Arm64, the shader gives no error, but incorrect output.

    What differences could there be? What might break my shader, if I target arm64?

    Unity 2019.2.9 - Testing on a Samsung S9
    Thank you!
     
  2. talofen

    talofen

    Joined:
    Jan 1, 2019
    Posts:
    40
    Quick follow up:
    The shader performs various operations on 1d arrays. I tried sending smaller arrays, and with the smaller arrays the shader gives expected results on both armv7 and arm64. With bigger arrays, only armv7 gives the expected results.

    There seems to be a size limit overflow on the (RW)StructuredBuffer used...what are these limits, and are they smaller in arm64?
    I could not find official documentation about this....
     
  3. talofen

    talofen

    Joined:
    Jan 1, 2019
    Posts:
    40
    PROBLEM SOLVED.

    It's a workaround, I think. I tried everything I could think of, changed the shader millions of times, alla settings I could think of...nothing worked.

    Then, inspired by a similar thread about issues with ARM64 crashing, I created a Keystore and a Project Key (under Publishing Settings)….and the project works like a charm! No more errors, no more crashes.

    The debugger key is clearly flawed somehow if you build for ARM64. I think this workaround should not be needed, and I think they might be working on this. There's a lot of posts of issues with ARM64....

    IMHO, devs might consider posting something about it while they work on a fix, and they might pin a post stating that you currently need to create a project key if you target ARM64...this is not straightforward as a workaround, and it took me almost a month to figure out how to solve the issue...