diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-27 12:22:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-27 12:24:02 +0300 |
commit | efef0ee672d5a65c8cb4a37f2837a371def6daaa (patch) | |
tree | aec294e98ee2b7d6be1d8d39a693334db41a9a93 /source/blender/gpu/intern/gpu_select_pick.c | |
parent | 24f759ba5a16305d57c285dbff080d8adb116ed1 (diff) | |
parent | 4de50d757233009ccd5db8538fd036a62ce58648 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/gpu/intern/gpu_select_pick.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_select_pick.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c index f1d311890e6..2d36c6f120c 100644 --- a/source/blender/gpu/intern/gpu_select_pick.c +++ b/source/blender/gpu/intern/gpu_select_pick.c @@ -524,6 +524,19 @@ bool gpu_select_pick_load_id(unsigned int id) return true; } + /** + * (Optional), call before 'gpu_select_pick_end' if GL context is not kept. + * is not compatible with regular select case. + * */ +void gpu_select_pick_finalize(void) +{ + GPUPickState *ps = &g_pick_state; + if (ps->gl.is_init) { + /* force finishing last pass */ + gpu_select_pick_load_id(ps->gl.prev_id); + } +} + unsigned int gpu_select_pick_end(void) { GPUPickState *ps = &g_pick_state; @@ -533,10 +546,7 @@ unsigned int gpu_select_pick_end(void) #endif if (ps->is_cached == false) { - if (ps->gl.is_init) { - /* force finishing last pass */ - gpu_select_pick_load_id(ps->gl.prev_id); - } + gpu_select_pick_finalize(); gpuPopAttrib(); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); |