Fix T54190: Occlusion query select failed
authorCampbell Barton <ideasman42@gmail.com>
Thu, 1 Mar 2018 05:31:36 +0000 (16:31 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 1 Mar 2018 05:37:39 +0000 (16:37 +1100)
commita459ef2827f1bb9e6ce92b0946a7463061c9ac55
treef09abc5323903e5c879a96705534284891d903a8
parent68015f9d397124b66fd8b435b729fbc0daa6e9ad
Fix T54190: Occlusion query select failed

By default select wasn't picking the nearest object,
this could have been fixed by not clearing the depth buffer,
but calling GPU_select_(begin/end) without the binded frame-buffer
caused issues for depth-picking. So move GPU_select begin/end to a
callback.

This also has the advantage that only needs to populate the engines once
to draw two passes.

Note that cycling through objects fails with occlusion queries still,
will fix shortly.
source/blender/draw/DRW_engine.h
source/blender/draw/intern/draw_manager.c
source/blender/editors/space_view3d/view3d_view.c