+ // Contains everything needed to re-link the program.
+ struct ShaderSpec {
+ GLuint vs_obj, fs_obj;
+ std::vector<std::string> fragment_shader_outputs;
+ };
+ std::map<GLuint, ShaderSpec> program_shaders;
+
+ // For each program, a list of other programs that are exactly like it.
+ // By default, will only contain the program itself, but due to cloning
+ // (see use_glsl_program()), may grow. Programs are taken off this list
+ // while they are in use (by use_glsl_program()).
+ std::map<GLuint, std::stack<GLuint> > program_instances;
+
+ // For each program, the master program that created it
+ // (inverse of program_instances).
+ std::map<GLuint, GLuint> program_masters;