Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/gpu/opengl/gl_shader.cc')
-rw-r--r--source/blender/gpu/opengl/gl_shader.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc
index ac2490e10ee..b336d56efcf 100644
--- a/source/blender/gpu/opengl/gl_shader.cc
+++ b/source/blender/gpu/opengl/gl_shader.cc
@@ -21,6 +21,8 @@
* \ingroup gpu
*/
+#include "BKE_global.h"
+
#include "BLI_string.h"
#include "GPU_extensions.h"
@@ -131,10 +133,14 @@ GLuint GLShader::create_shader_stage(GLenum gl_stage, MutableSpan<const char *>
GLint status;
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
- if (!status) {
- char log[5000];
+ if (!status || (G.debug & G_DEBUG_GPU)) {
+ char log[5000] = "";
glGetShaderInfoLog(shader, sizeof(log), NULL, log);
- this->print_errors(sources, log);
+ if (log[0] != '\0') {
+ this->print_errors(sources, log);
+ }
+ }
+ if (!status) {
glDeleteShader(shader);
return 0;
}