Search Unity

is there a max size to uniform array in ogles 2.0?

Discussion in 'Shaders' started by neoshaman, Feb 21, 2020.

  1. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Hello

    Is there a limit to the number of uniform I can pass in ogles 2.0? Is it specific to hardware? How can I verify a specific platform?

    Thanks!

    EDIT:
    I know unity limit array to 1023 (not 1024) in size, but I find outside data (not unity) that says there hardware is limited to 512. I just want to know more about that.
     
    Last edited: Feb 22, 2020
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    Hi!
    You're guaranteed to have at least 128 float4s.
    This doesn't mean that the HW can use that much efficiently, though :)
    You can check your shader with Mali Offline Shader Compiler, it will tell you if "register spilling" is used. If it is, it does not have enough fast memory for uniforms, and will fetch the data from main memory (very slow).
     
    Invertex and neoshaman like this.
  3. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Thanks !
     
    aleksandrk likes this.