common-ogl: Fix Program linked with warnings log spam on gl.

Mostly observed on amd driver.
This commit is contained in:
lightningterror 2023-01-01 10:31:43 +01:00
parent 1dff9897c9
commit 48b9d2f53e
1 changed files with 5 additions and 1 deletions

View File

@ -249,9 +249,13 @@ namespace GL
glGetProgramiv(m_program_id, GL_LINK_STATUS, &status);
GLint info_log_length = 0;
// Log will create a new line when there are no warnings so let's set a minimum log length of 1.
constexpr int info_log_min_length = 1;
glGetProgramiv(m_program_id, GL_INFO_LOG_LENGTH, &info_log_length);
if (status == GL_FALSE || info_log_length > 0)
if (status == GL_FALSE || info_log_length > info_log_min_length)
{
std::string info_log;
info_log.resize(info_log_length + 1);