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:
authorMike Erwin <significant.bit@gmail.com>2016-08-19 07:52:52 +0300
committerMike Erwin <significant.bit@gmail.com>2016-08-19 07:52:52 +0300
commit7e02d335c0ce9e88fb08d1e499b6563980d0d8e9 (patch)
treeb2947ed9ff95766abf6d652a0c9aab2eff08f760 /source/blender/windowmanager
parentd8f036efd6a57c9bd2e1ed626eee7d73bd73965b (diff)
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.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c14
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c4
2 files changed, 4 insertions, 14 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 3825db14e93..b0586e8111a 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -376,7 +376,7 @@ static void wm_draw_triple_fail(bContext *C, wmWindow *win)
wm_method_draw_overlap_all(C, win, 0);
}
-static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
+static bool wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
{
const int winsize_x = WM_window_pixels_x(win);
const int winsize_y = WM_window_pixels_y(win);
@@ -400,7 +400,7 @@ static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
if (!triple->bind) {
/* not the typical failure case but we handle it anyway */
printf("WM: failed to allocate texture for triple buffer drawing (glGenTextures).\n");
- return 0;
+ return false;
}
/* proxy texture is only guaranteed to test for the cases that
@@ -411,7 +411,7 @@ static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
glBindTexture(triple->target, 0);
printf("WM: failed to allocate texture for triple buffer drawing "
"(texture too large for graphics card).\n");
- return 0;
+ return false;
}
/* setup actual texture */
@@ -421,13 +421,7 @@ static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple)
glTexParameteri(triple->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glBindTexture(triple->target, 0);
- /* not sure if this works everywhere .. */
- if (glGetError() == GL_OUT_OF_MEMORY) {
- printf("WM: failed to allocate texture for triple buffer drawing (out of memory).\n");
- return 0;
- }
-
- return 1;
+ return true;
}
void wm_triple_draw_textures(wmWindow *win, wmDrawTriple *triple, float alpha)
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 01dc77127d2..751e714a456 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -68,8 +68,6 @@
#include "RNA_access.h"
-#include "GPU_debug.h"
-
#include "UI_interface.h"
#include "PIL_time.h"
@@ -2526,8 +2524,6 @@ void wm_event_do_handlers(bContext *C)
/* update key configuration after handling events */
WM_keyconfig_update(wm);
-
- GPU_ASSERT_NO_GL_ERRORS("wm_event_do_handlers");
}
/* ********** filesector handling ************ */