Forums - glGetActiveUniform bug for uniform array used both in vertex & fragment shaders.

2 posts / 0 new
Last post
glGetActiveUniform bug for uniform array used both in vertex & fragment shaders.
liqinlin
Join Date: 7 Jun 13
Posts: 2
Posted: Tue, 2016-07-05 23:21

Shaders below reproduce this bug on Galaxy S7 Edge with adreno 530 inside.

Vertex Shader:

uniform mediump vec4 Array[20];
attribute vec4 Position;
varying mediump vec4 Out;
void main() {
gl_Position = Array[1] + Position;
Out = Array[4];
}
 
Fragment Shader
 
uniform mediump vec4 Array[20];
varying mediump vec4 Out;
void main() {
gl_FragColor = Out + Array[3];
}
 
Compile the shaders and attach them to the same program object.
Use API glGetActiveUniform check uniform "Array[", we get the wrong num 4, but the right answer must be 5 or more.
 
It seems that when both vs & fs references the same array uniform, the linked program use the number that fs actually used instead of max(vs used, fs used)

 

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Wed, 2016-07-06 13:16

We have confirmed this is an open issue and should be able to provide an update in future drivers. Thanks for bringing it to our attention

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.