cginternals / globjects

C++ library strictly wrapping OpenGL objects.
https://globjects.org
MIT License
538 stars 59 forks source link

Add support for shader subroutines #355

Open j-o opened 7 years ago

j-o commented 7 years ago

See https://www.khronos.org/opengl/wiki/Shader_Subroutine

glUniformSubroutinesuiv must be called after every call to glUseProgram to (re-)activate subroutines. Since subroutines have not much in common with normal uniforms, I suggest a special integration: store a list of selected subroutine indices by shader type inside Program, expose corresponding get/set functions and call glUniformSubroutinesuiv in Program::use() if the list is non-empty. (Plus the same for ProgramPipeline)

scheibel commented 7 years ago

Sounds reasonable. Do you have a preliminary implementation?

j-o commented 7 years ago

Nope, haven't started this.