diff options
Diffstat (limited to 'source/blender/gpu/intern/gpu_batch_presets.c')
-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); |