From d0ead3e19555bf5a75c7acb61a2bfe5766de8c89 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Sun, 2 Jun 2019 18:15:06 +0200 Subject: [PATCH] - Fixed uninitialized variable in case GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS does not exist. Old graphics, like mine (Intel Sandybridge Mobile, GL 3.0 Mesa) do not support this, therefore most of the time RFL_SHADER_STORAGE_BUFFER wasn't unset (I found no consequence of this on my machine, but better safe than sorry). Found out by Valgrind. --- src/rendering/gl_load/gl_interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rendering/gl_load/gl_interface.cpp b/src/rendering/gl_load/gl_interface.cpp index 72806a6a033..69c1c258fe1 100644 --- a/src/rendering/gl_load/gl_interface.cpp +++ b/src/rendering/gl_load/gl_interface.cpp @@ -177,7 +177,7 @@ void gl_LoadExtensions() // Mesa implements shader storage only for fragment shaders. // Just disable the feature there. The light buffer may just use a uniform buffer without any adverse effects. - int v; + int v = 0; glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, &v); if (v == 0) gl.flags &= ~RFL_SHADER_STORAGE_BUFFER;