Results 1 to 2 of 2

Thread: Limits of GLSL Arrays

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    5

    Limits of GLSL Arrays

    In an earlier question, I asked about how to move more processing into the GPU.

    I think that may have been too vague, so lets just ask:
    - How large an array can I build in the shader? Is there a gl query function?
    - Can I index into the array with a variable rather than constant? The GLSL reference is a bit vague.
    - Ditto for a for(init, condx, incr) loop. Can the condx be i<variable rather than i<const?

    Thanks!

    -- Owen

  2. #2
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: Limits of GLSL Arrays

    The answer is it's implementation dependent.

    However, the usual trick is to pack large arrays into textures - which gives you a practical limit up in the millions. You can generally rely on having 2048x2048 by four (RGBA).

Similar Threads

  1. Replies: 2
    Last Post: 07-21-2009, 01:14 PM
  2. Vertex limits?
    By d1mbu1b in forum OpenGL ES general technical discussions
    Replies: 7
    Last Post: 09-15-2008, 11:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •