From 4de50d757233009ccd5db8538fd036a62ce58648 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 27 Feb 2018 20:16:53 +1100 Subject: GPU_select: utility function to finalize selection Needed for depth picking in 2.8 --- source/blender/gpu/intern/gpu_select.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source/blender/gpu/intern/gpu_select.c') diff --git a/source/blender/gpu/intern/gpu_select.c b/source/blender/gpu/intern/gpu_select.c index 632b0cfee1b..e2837d96b0f 100644 --- a/source/blender/gpu/intern/gpu_select.c +++ b/source/blender/gpu/intern/gpu_select.c @@ -149,6 +149,29 @@ bool GPU_select_load_id(unsigned int id) } } +/** + * Needed when GL context of #GPU_select_end + * can't be used to finalize selection operations + * (because of context changes). + */ +void GPU_select_finalize(void) +{ + if (!g_select_state.select_is_active) + return; + + switch (g_select_state.algorithm) { + case ALGO_GL_LEGACY: + case ALGO_GL_QUERY: + { + break; + } + default: /* ALGO_GL_PICK */ + { + gpu_select_pick_finalize(); + } + } +} + /** * Cleanup and flush selection results to buffer. * Return number of hits and hits in buffer. -- cgit v1.2.3