Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Uniform arrays locations

  1. #1
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,072

    Uniform arrays locations

    Hi guys,

    Recently I have discovered very awkward behavior of NV drivers. Namely, when calling glGetUniformLocation() for array element with index greater than 11, the returned value is unpredictable. I have discovered it after noticing some overwriting in my shaders. Values were changed stochastically on the first glance. But after careful examination I have discovered they were mirrored from other uniforms. Even the newest driver (326.29) exposes that behavior (first noticed on 266.58). I have patched it by calculating location using starting location (location of uniform with index 0) and index as an offset. Beware of this!

    Does AMD have a similar bug? Or is it a bug at all?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    the returned value is unpredictable
    Define "unpredictable". Also, what kind of array is it? The only time array indices are "predictable" are if an explicit uniform location is being used (in which case you don't need to ask) or if it is an array of basic types (ie: not a struct or array). If it's not an array of basic types, all bets are off as far as uniform location layout is concerned.

  3. #3
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,072
    I'm really sorry! This was a false alarm. The problem was in CPU code and allocation space for uniform array locations.

    I beg moderators or a Web master to remove this thread.
    Last edited by Aleksandar; 08-08-2013 at 09:47 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
  •