diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-27 12:44:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-27 12:44:12 +0300 |
commit | a7ef3126115e907e03efac2297eea725017477f2 (patch) | |
tree | ff51d7e40a512c6dda7d0a83619b2661e783e275 /source/blender/gpu/intern | |
parent | 4de50d757233009ccd5db8538fd036a62ce58648 (diff) |
GPU_select: correction to select-pick-finalize
Would run twice, harmless at the moment but could cause issues later.
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 d7a3ad07558..bd6b43ee42f 100644 --- a/source/blender/gpu/intern/gpu_select_pick.c +++ b/source/blender/gpu/intern/gpu_select_pick.c @@ -255,6 +255,7 @@ typedef struct GPUPickState { /* Set after first draw */ bool is_init; + bool is_finalized; unsigned int prev_id; } gl; @@ -366,6 +367,7 @@ void gpu_select_pick_begin( #endif ps->gl.is_init = false; + ps->gl.is_finalized = false; ps->gl.prev_id = 0; } else { @@ -537,6 +539,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) @@ -548,7 +551,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(); + } glPopAttrib(); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); |