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:
authorAntony Riakiotakis <kalast@gmail.com>2015-07-20 15:37:22 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-07-20 15:46:11 +0300
commitdb38a65b022cd11892034d6882d643fd46d618c8 (patch)
treecf856905ee67da79d0d3e2cea245f4915ca11abf /source/blender/gpu/intern/gpu_debug.c
parent2e2164d5d4449ad7faa320cbbda68a72105903a3 (diff)
Filter the debug callback to only report errors unless debug value is
20. stderr was getting flooded with too many error messages, most of which were not really relevant.
Diffstat (limited to 'source/blender/gpu/intern/gpu_debug.c')
-rw-r--r--source/blender/gpu/intern/gpu_debug.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_debug.c b/source/blender/gpu/intern/gpu_debug.c
index 3066467517a..b9a22882133 100644
--- a/source/blender/gpu/intern/gpu_debug.c
+++ b/source/blender/gpu/intern/gpu_debug.c
@@ -163,11 +163,16 @@ const char* gpuErrorString(GLenum err)
#endif
-static void APIENTRY gpu_debug_proc(GLenum UNUSED(source), GLenum UNUSED(type), GLuint UNUSED(id),
+static void APIENTRY gpu_debug_proc(GLenum source, GLenum type, GLuint UNUSED(id),
GLenum UNUSED(severity), GLsizei UNUSED(length),
const GLchar *message, GLvoid *UNUSED(userParm))
{
- fprintf(stderr, "GL: %s\n", message);
+ if (source == GL_DEBUG_SOURCE_API && type == GL_DEBUG_TYPE_ERROR)
+ fprintf(stderr, "GL: %s\n", message);
+ else if (G.debug_value == 20) {
+ fprintf(stderr, "GL: %s\n", message);
+ }
+ fflush(stderr);
}