Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-03-07 11:55:33 +0300
committerCampbell Barton <campbell@blender.org>2022-03-07 11:55:33 +0300
commit25fc5876d3bb37018adcfe1a1b943b90d45f5f9a (patch)
tree97b7e7b37f2d55a290ec98712367320ab393c8ba /source/blender/windowmanager/gizmo
parentad2948face07abdfb11e236f7f4db08c5dbcac5a (diff)
Revert "Fix Crash: Switching to wireframe mode."
This reverts commit cb986446e29a51b07bdb73b999a0339df5ecdeb4.
Diffstat (limited to 'source/blender/windowmanager/gizmo')
-rw-r--r--source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
index f1ac19f4651..4b802ae3a0a 100644
--- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
+++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
@@ -580,14 +580,6 @@ static int gizmo_find_intersected_3d_intern(wmGizmo **visible_gizmos,
/* Fast-path (occlusion queries). */
GPU_SELECT_ALL);
- /* When switching between modes and the mouse pointer is over a gizmo, the highlight test is
- * performed before the viewport is fully initialized (region->draw_buffer = NULL).
- * When this is the case we should not use depth testing. */
- GPUViewport *gpu_viewport = WM_draw_region_get_viewport(region);
- if (use_depth_test && gpu_viewport == NULL) {
- return -1;
- }
-
if (GPU_select_is_cached()) {
GPU_select_begin(buffer, ARRAY_SIZE(buffer), &rect, gpu_select_mode, 0);
GPU_select_cache_load_id();
@@ -605,7 +597,8 @@ static int gizmo_find_intersected_3d_intern(wmGizmo **visible_gizmos,
* because all future passes the will use the cached depths. */
GPUFrameBuffer *depth_read_fb = NULL;
if (use_depth_test) {
- GPUTexture *depth_tx = GPU_viewport_depth_texture(gpu_viewport);
+ GPUViewport *viewport = WM_draw_region_get_viewport(CTX_wm_region(C));
+ GPUTexture *depth_tx = GPU_viewport_depth_texture(viewport);
GPU_framebuffer_ensure_config(&depth_read_fb,
{
GPU_ATTACHMENT_TEXTURE(depth_tx),