From 7e02d335c0ce9e88fb08d1e499b6563980d0d8e9 Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Fri, 19 Aug 2016 00:52:52 -0400 Subject: OpenGL: don't poll for errors, rely on KHR_debug Errors are caught & reported by our GL debug callback. This gives us way more useful information than sporadic calls to glGetError. I removed almost all use of glGetError, including our own GPU_ASSERT_NO_GL_ERRORS and GPU_CHECK_ERRORS_AROUND macros. Still used in rna_Image_gl_load because it passes unvalidated input to OpenGL functions. Still used in gpu_state_print_fl_ex as an exception handling hack -- will rewrite this soon. The optimism embodied by this commit will not prevent OpenGL errors. We need to analyze what would cause GL to fail at certain points and proactively intercept these failures. Or guarantee they can't happen. --- source/blender/gpu/GPU_debug.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'source/blender/gpu/GPU_debug.h') diff --git a/source/blender/gpu/GPU_debug.h b/source/blender/gpu/GPU_debug.h index 61b2bc591ce..921deaaa6d6 100644 --- a/source/blender/gpu/GPU_debug.h +++ b/source/blender/gpu/GPU_debug.h @@ -41,24 +41,9 @@ extern "C" { /* prints something if debug mode is active only */ void GPU_print_error_debug(const char *str); -/* replacement for gluErrorString */ -const char *gpuErrorString(GLenum err); - /* prints current OpenGL state */ void GPU_state_print(void); -void GPU_assert_no_gl_errors(const char *file, int line, const char *str); - -# define GPU_ASSERT_NO_GL_ERRORS(str) GPU_assert_no_gl_errors(__FILE__, __LINE__, (str)) - -# define GPU_CHECK_ERRORS_AROUND(glProcCall) \ - ( \ - GPU_ASSERT_NO_GL_ERRORS("Pre: " #glProcCall), \ - (glProcCall), \ - GPU_ASSERT_NO_GL_ERRORS("Post: " #glProcCall) \ - ) - - /* inserts a debug marker message for the debug context messaging system */ void GPU_string_marker(const char *str); -- cgit v1.2.3