The problem of atomic addition operation failing on large-sized buffers

When the size of Buffer<int>exceeds 65535, the atomic addition operation performed on the portion of Buffer that exceeds 65535 will not truly take effect.

I tested it using UE5's compute shader.

I tested it on MediaTek Dimensity 9300, which is G720. Is this a driver issue or a hardware limitation?

Qualcomm's Snapdragon 8Gen3 does not have this issue

  • Are you using any mediump/relaxed precision in your shader? Does it still happen if you remove that?

    When you say "size" do you mean number of bytes or number of ints?

    It's hard to be more specific without more information - please can you share your shader? You can contact developer@arm.com if this is not something you can share publicly. 

    Kind regards, 
    Pete

  • The driver team confirm that we do indeed have a compiler erratum that truncates the index of buffers atomics array accesses to 16-bits, which matches the fault that you are seeing. We don't know of any "neat" workaround unfortunately, so the options are really:

    • Breaking the buffer into chunks each less than 65536 entries, and indexing each chunk manually.
    • Swapping to a 2D texture buffer using a 2D index to expand the number of indexable elements.

    Kind regards, 
    Pete