PDA

View Full Version : unload/upload glsl programs



lobbel
07-28-2010, 01:47 PM
hello,
at what time has a glsl shader program been uploaded to
the gpu ? Is it possible to tell what shader program
has to be uploaded or "removed" from the gpu ?

regards,
cmos

Aleksandar
07-30-2010, 09:07 AM
The answer to a first question is pretty simple. glUseProgram() installs the program object as a part of current rendering state.

Even the answer to a second question is not so hard if I understood it correctly. glDeleteProgram() frees the memory and invalidates the name associated with the program object specified by program. If a program object is in use as part of a current rendering state, it will be flagged for deletion, but it will not be deleted until it is no longer part of current state for any rendering context. To determine whether a program object has been flagged for deletion, call glGetProgram() with arguments program and GL_DELETE_STATUS.

lobbel
07-30-2010, 09:23 AM
Thanks for the answer, was helpful.

regards & nice weekend,
lobbel