Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL: is it legal to attach a shader to a program that is in a valid linked state?

Tags:

opengl

I've searched for a definitive answer to this but to no avail. The OpenGL specs seem to be silent on this, but that may be due to my inexperience in reading them. I am not concerned with how implementations behave with regard to this issue. Thanks.

like image 920
UglyCoder Avatar asked Feb 11 '23 12:02

UglyCoder


1 Answers

From here:

While a program object is in use, applications are free to modify attached shader objects, compile attached shader objects, attach additional shader objects, and detach or delete shader objects. None of these operations will affect the executables that are part of the current state. However, relinking the program object that is currently in use will install the program object as part of the current rendering state if the link operation was successful...

So yes, it is legal, and it will have no effect until you relink the program.

And relink the current program automatically install the new version.

like image 185
Orace Avatar answered May 19 '23 18:05

Orace