| 38 | } |
| 39 | |
| 40 | Status CheckProgramLinked(GLuint program_id) { |
| 41 | GLint linked; |
| 42 | glGetProgramiv(program_id, GL_LINK_STATUS, &linked); |
| 43 | if (linked == GL_TRUE) { |
| 44 | return OkStatus(); |
| 45 | } |
| 46 | GLint info_size; |
| 47 | glGetProgramiv(program_id, GL_INFO_LOG_LENGTH, &info_size); |
| 48 | std::string errors; |
| 49 | errors.resize(info_size + 1 /* plus \0 */); |
| 50 | glGetProgramInfoLog(program_id, info_size + 1, nullptr, &errors[0]); |
| 51 | // TODO(akulik): use glValidateProgram to gather more info. |
| 52 | return UnavailableError("Program is not properly linked: " + errors); |
| 53 | } |
| 54 | |
| 55 | struct ParameterSetter { |
| 56 | Status operator()(int value) { |
no test coverage detected