int act_routines = 0;
int act_routine_max_len = 0;
char* temp_name = 0;
glapi.glGetProgramStageiv(_gl_program_obj, GL_FRAGMENT_SHADER,
GL_ACTIVE_SUBROUTINES, &act_routines);
glapi.glGetProgramStageiv(_gl_program_obj, GL_FRAGMENT_SHADER,
GL_ACTIVE_SUBROUTINE_MAX_LENGTH, &act_routine_max_len);
if (act_routine_max_len > 0) {
temp_name = new char[act_routine_max_len + 1]; // reserve for null termination
}
for (int i = 0; i < act_routines; ++i) {
std::string actual_routine_name;
unsigned actual_routine_index = 0;
int ret_size = 0;
glapi.glGetActiveSubroutineName(_gl_program_obj, GL_FRAGMENT_SHADER,
i, act_routine_max_len, &ret_size, temp_name);
gl_assert(glapi, program::retrieve_uniform_information() after retrieving subroutine info);
actual_routine_index =
glapi.glGetSubroutineIndex(_gl_program_obj, GL_FRAGMENT_SHADER,
temp_name);
gl_assert(glapi, program::retrieve_uniform_information() after retrieving subroutine info);
}
delete [] temp_name;