MCPcopy Create free account
hub / github.com/KTStephano/StratusGFX / checkProgramError

Function checkProgramError

Source/Engine/StratusPipeline.cpp:73–93  ·  view source on GitHub ↗

* Checks to see if any errors occured while linking * the shaders to the program. * @return true if nothing went wrong and false if anything * bad happened */

Source from the content-addressed store, hash-verified

71 * bad happened
72 */
73static bool checkProgramError(GLuint program, const std::vector<Shader> & shaders) {
74 GLint linkStatus;
75 glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
76 if (!linkStatus) {
77 std::string files;
78 for (auto& s : shaders) files += s.filename + " ";
79 STRATUS_ERROR << "[error] Program failed during linking ( files were: " << files << ")" << std::endl;
80
81 GLint logLength;
82 glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength);
83
84 if (logLength > 0) {
85 std::string errorLog;
86 errorLog.resize(static_cast<uint32_t>(logLength));
87 glGetProgramInfoLog(program, logLength, nullptr, &errorLog[0]);
88 std::cout << errorLog << std::endl;
89 }
90 return false;
91 }
92 return true;
93}
94
95static std::unordered_set<std::string> BuildFileList(const std::filesystem::path& root) {
96 std::unordered_set<std::string> result;

Callers 1

Compile_Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected