diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-11-04 19:30:25 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-11-04 19:30:25 +0300 |
commit | a5f4f1e2cea831415c045be4927320dc060798c9 (patch) | |
tree | 6ba079a4cadf5bdb10d6815326b42ebbd83259d0 /source/blender/windowmanager | |
parent | 4ff6e08a6df9dedfe26df539c1147481da07a9de (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')
-rw-r--r-- | source/blender/windowmanager/CMakeLists.txt | 3 | ||||
-rw-r--r-- | source/blender/windowmanager/SConscript | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 6 |
4 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index c5e8cbf1260..eaea70adc83 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -142,9 +142,6 @@ endif() if(WITH_OPENSUBDIV) add_definitions(-DWITH_OPENSUBDIV) - list(APPEND INC - ../../../intern/opensubdiv - ) endif() if(WIN32) diff --git a/source/blender/windowmanager/SConscript b/source/blender/windowmanager/SConscript index ec1b265d800..1a058ca3136 100644 --- a/source/blender/windowmanager/SConscript +++ b/source/blender/windowmanager/SConscript @@ -93,6 +93,5 @@ if env['OURPLATFORM'] in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', if env['WITH_BF_OPENSUBDIV']: defs.append("WITH_OPENSUBDIV") - incs += ' #intern/opensubdiv' env.BlenderLib ( 'bf_windowmanager', sources, Split(incs), defines=defs, libtype=['core'], priority=[5] ) 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) { |