From 48b9d2f53e89193aa5acc7c322d43f8f4efab4cb Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Sun, 1 Jan 2023 10:31:43 +0100 Subject: [PATCH] common-ogl: Fix Program linked with warnings log spam on gl. Mostly observed on amd driver. --- common/GL/Program.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/GL/Program.cpp b/common/GL/Program.cpp index ce0169c80a..a1afb5e96e 100644 --- a/common/GL/Program.cpp +++ b/common/GL/Program.cpp @@ -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);