Page MenuHome

macOS edit mode selection not working on second display
Closed, ArchivedPublic

Description

In dual-display, one of the monitors cannot be selected in edit mode, including vertex select, edge select, face select.

System Information
Operating system: Darwin-17.7.0-x86_64-i386-64bit 64 Bits
Graphics card: NVIDIA GeForce GTX 1070 OpenGL Engine NVIDIA Corporation 4.1 NVIDIA-10.33.0 387.10.10.10.40.122

Blender Version
Broken: version: 2.80 (sub 57), branch: blender2.7, commit date: 2019-04-16 20:13, hash: rB5d8030b8f3cf
Worked: (optional)

Short description of error
[Please fill out a short description of the error here]

Exact steps for others to reproduce the error
[Please describe the exact steps needed to reproduce the issue]
[Based on the default startup or an attached .blend file (as simple as possible)]

Details

Type
Bug

Event Timeline

Brecht Van Lommel (brecht) renamed this task from cannot be selected in edit mode in dual-display to macOS edit mode selection not working on second display.

This is a shot in the dark, but considering that what changes from one display to the other is the OpenGL context, maybe if we force glReadPixel to run in the offscreen context, this bug is solved.

diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 7a95120b273..eac4088eed2 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -2863,7 +2863,19 @@ void DRW_framebuffer_select_id_read(const rcti *rect, uint *r_buf)
 
   rcti rect_clamp = *rect;
   if (BLI_rcti_isect(&r, &rect_clamp, &rect_clamp)) {
-    GPU_texture_read_rect(g_select_buffer.texture_u32, GPU_DATA_UNSIGNED_INT, &rect_clamp, r_buf);
+    DRW_opengl_context_enable();
+    GPU_framebuffer_bind(g_select_buffer.framebuffer_select_id);
+    glReadBuffer(GL_COLOR_ATTACHMENT0);
+    glReadPixels(rect_clamp.xmin,
+                 rect_clamp.ymin,
+                 BLI_rcti_size_x(&rect_clamp),
+                 BLI_rcti_size_y(&rect_clamp),
+                 GL_RED_INTEGER,
+                 GL_UNSIGNED_INT,
+                 r_buf);
+
+    GPU_framebuffer_restore();
+    DRW_opengl_context_disable();
 
     if (!BLI_rcti_compare(rect, &rect_clamp)) {
       GPU_select_buffer_stride_realign(rect, &rect_clamp, r_buf);

@zhaoyunlai (lyman), @MICHAEL JEAN BAPTISTE (fhqgroup), could you check if this bug has been solved in the latest builds?

Brecht Van Lommel (brecht) triaged this task as Needs Information from User priority.May 31 2019, 8:12 PM
Brecht Van Lommel (brecht) closed this task as Archived.
Brecht Van Lommel (brecht) claimed this task.

Closing due to lack of information to investigate further, we can reopen the report if this is still an issue.