3
votes

I've noticed some things that aren't well explained in the opengl docs. Please correct me if I'm wrong.

  1. You can't set the value of a uniform if the program isn't the one that opengl is using at that moment. That will generate an error.

  2. If you set the value of a uniform in program A, then switch to program B, then switch back to program A, the value stays. Is this reliable?

  3. There is no way to set a uniform value to a program that isn't being used at that moment. Is there a workaround?

1

1 Answers

5
votes
  1. the Direct State Access extension (which is included in core 4.5) allows you to set the uniform to a non bound program using glProgramUniform*EXT and you will need to specify the program.

  2. uniforms are stored per program,

  3. see 1