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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-11-04 19:30:25 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-11-04 19:30:25 +0300
commita5f4f1e2cea831415c045be4927320dc060798c9 (patch)
tree6ba079a4cadf5bdb10d6815326b42ebbd83259d0 /source/blender/windowmanager/intern
parent4ff6e08a6df9dedfe26df539c1147481da07a9de (diff)
OpenSubdiv: Use pool for delayed OpenGL buffers free when freeing from non-main thread
This is really similar to what GPU module was already doing. There are number of possible improvements still: - Re-use allocated VAOs when requesting new ones instead of going to the trouble of freeing VAO and then re-creating it again. - Move VAO handling to GPU module. Fixes T46589: OpenSubdiv crash with drivers
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c8
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 16fe9ca5142..6ad0405c56f 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -69,6 +69,10 @@
#include "wm_window.h"
#include "wm_event_system.h"
+#ifdef WITH_OPENSUBDIV
+# include "BKE_subsurf.h"
+#endif
+
/* swap */
#define WIN_NONE_OK 0
#define WIN_BACK_OK 1
@@ -1002,6 +1006,10 @@ void wm_draw_update(bContext *C)
wmWindow *win;
int drawmethod;
+#ifdef WITH_OPENSUBDIV
+ BKE_subsurf_free_unused_buffers();
+#endif
+
GPU_free_unused_buffers();
for (win = wm->windows.first; win; win = win->next) {
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index ba4a807dbd7..d528b658836 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -118,7 +118,7 @@
#include "COM_compositor.h"
#ifdef WITH_OPENSUBDIV
-# include "opensubdiv_capi.h"
+# include "BKE_subsurf.h"
#endif
static void wm_init_reports(bContext *C)
@@ -196,7 +196,7 @@ void WM_init(bContext *C, int argc, const char **argv)
GPU_set_gpu_mipmapping(U.use_gpu_mipmap);
#ifdef WITH_OPENSUBDIV
- openSubdiv_init();
+ BKE_subsurf_osd_init();
#endif
UI_init();
@@ -547,7 +547,7 @@ void WM_exit_ext(bContext *C, const bool do_python)
#endif
#ifdef WITH_OPENSUBDIV
- openSubdiv_cleanup();
+ BKE_subsurf_osd_cleanup();
#endif
if (!G.background) {