From 056fa85699abf7979e718ff0945942c2acecdec6 Mon Sep 17 00:00:00 2001 From: Christoph Neuhauser Date: Wed, 2 Apr 2025 15:51:24 +0200 Subject: [PATCH] Fix #132196: UI: Camera gizmo cannot be shifted on Intel GPUs GPU_DEPTH_NONE leads to issues with Intel GPU drivers on Windows where camera gizmos cannot be shifted. glGetQueryObjectuiv for GL_SAMPLES_PASSED seems to return zero in all cases. This might be due to undefined behavior of OpenGL when the depth test is disabled and rendering to a depth render target-only framebuffer. Using GPU_DEPTH_ALWAYS fixes the issue. Pull Request: https://projects.blender.org/blender/blender/pulls/136607 --- source/blender/windowmanager/gizmo/intern/wm_gizmo_map.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.cc b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.cc index ccf3d534304..ef96f32f2bd 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.cc +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.cc @@ -535,7 +535,12 @@ static void gizmo_draw_select_3d_loop(const bContext *C, GPU_depth_test(GPU_DEPTH_LESS_EQUAL); } else { - GPU_depth_test(GPU_DEPTH_NONE); + /* WORKAROUND(#132196): `GPU_DEPTH_NONE` leads to issues with Intel GPU drivers on Windows + * where camera gizmos cannot be shifted. `glGetQueryObjectuiv` for `GL_SAMPLES_PASSED` + * seems to return zero in all cases. This might be due to undefined behavior of OpenGL + * when the depth test is disabled and rendering to a depth render target-only framebuffer. + * Using `GPU_DEPTH_ALWAYS` fixes the issue. */ + GPU_depth_test(GPU_DEPTH_ALWAYS); } is_depth_prev = is_depth; }