5
$\begingroup$

I have a shader which has several uniform variables:

uniform vec4 a;
uniform vec4 b;
uniform vec4 c;

I'm getting these handles using glGetUniformLocation() and storing them in the array. The game was suspended, then resumed and onSurfaceCreated() has been called. The question is: whether these handles will be valid or I need to re-get them using glGetUniformLocation() once again?

$\endgroup$
1
6
$\begingroup$

The uniform locations are set when the program is linked and are tied to the program.

This means that when you create a new program then the uniform locations can change.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.