Skip to content

Commit

Permalink
common-ogl: Fix Shader compiled with warnings log spam on gl.
Browse files Browse the repository at this point in the history
Observed on intel igpu.
  • Loading branch information
lightningterror committed Jan 23, 2023
1 parent ddd2ea5 commit d9f4bc7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/GL/Program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ namespace GL
GLint info_log_length = 0;
glGetShaderiv(id, GL_INFO_LOG_LENGTH, &info_log_length);

if (status == GL_FALSE || 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;

if (status == GL_FALSE || info_log_length > info_log_min_length)
{
std::string info_log;
info_log.resize(info_log_length + 1);
Expand Down

0 comments on commit d9f4bc7

Please sign in to comment.