Commit: d2f1705b15be406d5565e510ae82f07d27345af1 Author: Clément Foucault Date: Sat Apr 27 20:37:11 2019 +0200 Branches: master https://developer.blender.org/rBd2f1705b15be406d5565e510ae82f07d27345af1
Fix T63936 GPUSelect: Read depth in the end fix T63936 introduced in 86914e713347. Reviewers: fclem Reviewed By: fclem Tags: #bf_blender Maniphest Tasks: T63936 Differential Revision: https://developer.blender.org/D4750 =================================================================== M source/blender/gpu/intern/gpu_select.c M source/blender/gpu/intern/gpu_select_pick.c M source/blender/gpu/intern/gpu_select_private.h =================================================================== diff --git a/source/blender/gpu/intern/gpu_select.c b/source/blender/gpu/intern/gpu_select.c index 17d3321560d..010087e5536 100644 --- a/source/blender/gpu/intern/gpu_select.c +++ b/source/blender/gpu/intern/gpu_select.c @@ -120,7 +120,7 @@ bool GPU_select_load_id(uint id) } default: /* ALGO_GL_PICK */ { - return gpu_select_pick_load_id(id); + return gpu_select_pick_load_id(id, false); } } } diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c index ffd4cd6efbc..1880a0cfbdf 100644 --- a/source/blender/gpu/intern/gpu_select_pick.c +++ b/source/blender/gpu/intern/gpu_select_pick.c @@ -476,12 +476,12 @@ static void gpu_select_load_id_pass_nearest(const DepthBufCache *rect_prev, } } -bool gpu_select_pick_load_id(uint id) +bool gpu_select_pick_load_id(uint id, bool end) { GPUPickState *ps = &g_pick_state; if (ps->gl.is_init) { - if (id == ps->gl.prev_id) { + if (id == ps->gl.prev_id && !end) { /* No need to read if we are still drawing for the same id since * all these depths will be merged / deduplicated in the end. */ return true; @@ -543,7 +543,7 @@ uint gpu_select_pick_end(void) 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_load_id(ps->gl.prev_id, true); } gpuPopAttr(); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); diff --git a/source/blender/gpu/intern/gpu_select_private.h b/source/blender/gpu/intern/gpu_select_private.h index bc40e58ba96..a0619bd4293 100644 --- a/source/blender/gpu/intern/gpu_select_private.h +++ b/source/blender/gpu/intern/gpu_select_private.h @@ -28,7 +28,7 @@ /* gpu_select_pick */ void gpu_select_pick_begin(uint (*buffer)[4], uint bufsize, const rcti *input, char mode); -bool gpu_select_pick_load_id(uint id); +bool gpu_select_pick_load_id(uint id, bool end); uint gpu_select_pick_end(void); void gpu_select_pick_cache_begin(void); _______________________________________________ Bf-blender-cvs mailing list [email protected] https://lists.blender.org/mailman/listinfo/bf-blender-cvs
