diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-02-26 21:49:06 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-02-26 21:49:06 +0300 |
commit | fa7e4cc685d4f2af50a36ce8c5bc61d1dd918bae (patch) | |
tree | 9480d9b9df886ee25f0458543bcd436f5fb1605d /source/blender/gpu/intern | |
parent | 13261304a331b4cff37de477ddf19c915ed64b2c (diff) |
WM/GPU: Clear VAO cache of batch preset when switching context.
This is needed for multiple windows to draw the batch presets.
This will not be needed once we use only one context for UI.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_batch_presets.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_batch_presets.c b/source/blender/gpu/intern/gpu_batch_presets.c index 21d6906083a..950f1a2dab3 100644 --- a/source/blender/gpu/intern/gpu_batch_presets.c +++ b/source/blender/gpu/intern/gpu_batch_presets.c @@ -193,6 +193,17 @@ void gpu_batch_presets_init(void) g_presets_3d.batch.sphere_wire_med = batch_sphere_wire(8, 16); } +void gpu_batch_presets_reset(void) +{ + /* Reset vao caches for these every time we switch opengl context. + * This way they will draw correctly for each window. */ + gwn_batch_vao_cache_clear(g_presets_3d.batch.sphere_low); + gwn_batch_vao_cache_clear(g_presets_3d.batch.sphere_med); + gwn_batch_vao_cache_clear(g_presets_3d.batch.sphere_high); + gwn_batch_vao_cache_clear(g_presets_3d.batch.sphere_wire_low); + gwn_batch_vao_cache_clear(g_presets_3d.batch.sphere_wire_med); +} + void gpu_batch_presets_exit(void) { GWN_batch_discard(g_presets_3d.batch.sphere_low); |