diff options
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_select_pick.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c index 2d36c6f120c..8c102a307ea 100644 --- a/source/blender/gpu/intern/gpu_select_pick.c +++ b/source/blender/gpu/intern/gpu_select_pick.c @@ -257,6 +257,7 @@ typedef struct GPUPickState { /* Set after first draw */ bool is_init; + bool is_finalized; unsigned int prev_id; } gl; @@ -364,6 +365,7 @@ void gpu_select_pick_begin( #endif ps->gl.is_init = false; + ps->gl.is_finalized = false; ps->gl.prev_id = 0; } else { @@ -535,6 +537,7 @@ void gpu_select_pick_finalize(void) /* force finishing last pass */ gpu_select_pick_load_id(ps->gl.prev_id); } + ps->gl.is_finalized = true; } unsigned int gpu_select_pick_end(void) @@ -546,7 +549,9 @@ unsigned int gpu_select_pick_end(void) #endif if (ps->is_cached == false) { - gpu_select_pick_finalize(); + if (ps->gl.is_finalized == false) { + gpu_select_pick_finalize(); + } gpuPopAttrib(); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); |