I have a program where I use a shader program to render to a texture attached to a FBO then change the parameters of the program (by changing the values of the uniforms) and render to a second texture after attaching it to the FBO. The two rendered images are then used to generate a third one.
I'm not sure if the results I'm getting is correct. I understand that the GPU will be free to choose the time at which to execute an OpenGL command. But that should not be a problem so long as the order of execution does follow the sequence in which the commands appear in the code. Is this actually the case?
A follow-up question. I need to save the generated frames to disk. I know how to that. But I need to make sure that the GPU has completed the rendering before doing so. How can I enforce that?
glFinish()
but I still have this mismatch problem I mention in my second comment on user1781290's answer. – informer2000