Reporting: Ignore link error with bad shaders.

We only need the issue reported once.
This commit is contained in:
Unknown W. Brackets 2018-11-22 07:58:08 -08:00
parent 10fa20cb06
commit c944063d03

View File

@ -171,8 +171,10 @@ void GLQueueRunner::RunInitSteps(const std::vector<GLRInitStep> &steps, bool ski
GLRProgram *program = step.create_program.program;
program->program = glCreateProgram();
_assert_msg_(G3D, step.create_program.num_shaders > 0, "Can't create a program with zero shaders");
bool anyFailed = false;
for (int j = 0; j < step.create_program.num_shaders; j++) {
_dbg_assert_msg_(G3D, step.create_program.shaders[j]->shader, "Can't create a program with a null shader");
anyFailed = anyFailed || step.create_program.shaders[j]->failed;
glAttachShader(program->program, step.create_program.shaders[j]->shader);
}
@ -208,7 +210,8 @@ void GLQueueRunner::RunInitSteps(const std::vector<GLRInitStep> &steps, bool ski
std::string fsDesc = fs ? (fs->desc + (fs->failed ? " (failed)" : "")) : "(none)";
const char *vsCode = vs->code.c_str();
const char *fsCode = fs ? fs->code.c_str() : "(none)";
Reporting::ReportMessage("Error in shader program link: info: %s\nfs: %s\n%s\nvs: %s\n%s", infoLog.c_str(), fsDesc.c_str(), fsCode, vsDesc.c_str(), vsCode);
if (!anyFailed)
Reporting::ReportMessage("Error in shader program link: info: %s\nfs: %s\n%s\nvs: %s\n%s", infoLog.c_str(), fsDesc.c_str(), fsCode, vsDesc.c_str(), vsCode);
ELOG("Could not link program:\n %s", infoLog.c_str());
ERROR_LOG(G3D, "VS desc:\n%s", vsDesc.c_str());