From c944063d03cbebb4223060da5620002796975e17 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 22 Nov 2018 07:58:08 -0800 Subject: [PATCH] Reporting: Ignore link error with bad shaders. We only need the issue reported once. --- ext/native/thin3d/GLQueueRunner.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/native/thin3d/GLQueueRunner.cpp b/ext/native/thin3d/GLQueueRunner.cpp index 49031eafca..828aab92b8 100644 --- a/ext/native/thin3d/GLQueueRunner.cpp +++ b/ext/native/thin3d/GLQueueRunner.cpp @@ -171,8 +171,10 @@ void GLQueueRunner::RunInitSteps(const std::vector &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 &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());