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?
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.