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/intern/wm_draw.c | |
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/intern/wm_draw.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 8 |
1 files changed, 8 insertions, 0 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) { |