Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

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:
    5,146
    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:
    1,365
    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:
    5,146
    Thanks !
     
    aleksandrk likes this.
unityunity