imgui icon indicating copy to clipboard operation
imgui copied to clipboard

Multi viewport windows: Docking node artifacting when secondary window is quickly moved over node

Open PatrickDahlin opened this issue 10 months ago • 3 comments

Version/Branch of Dear ImGui:

Version: 1.87 Branch: docking and multi-viewports enabled

Back-end/Renderer/Compiler/OS Vulkan with GLFW built on msvc

Back-ends: imgui_impl_vulkan.cpp + imgui_impl_glfw.cpp Operating System: Windows 10

My Issue/Question:

Docking nodes seem to glitch/bug out visually when moving a secondary window ontop. (See video for reference) This has been reproduced in both Walnut and a private project using a newer version of imgui (v1.89.7). It's worth noting that while Walnut is using a fork with some slight modifications, the private project I used with 1.89.7 has no modifications and still reproduces this. (vulkan, glfw, so similar setup as walnut)

I'm 100% sure this isnt an issue with the modifications that Walnut has done to it's fork of imgui because of the earlier mentioned private project being implemented using non-modified version and still showing this behaviour.

This delay of the docking node movement seems to be more noticable on a higher refreshrate monitor, which in turn would lend itself to this being a latency issue with the window movement. (wild guess)

I am not sure how to debug an issue as this since it seems to be with frame to frame timing and window movements, and I'm not that familiar with that part of imgui. I will gather more info if need be.

Screenshots/Video

Note how the docking node is moving around when the secondary window is moved ontop of the main window. https://github.com/ocornut/imgui/assets/33965707/a85bb6da-117e-4cab-aede-2cf6bdf503b0

Cloning Walnut from master and running that project is one way to reproduce this.

PatrickDahlin avatar Aug 18 '23 22:08 PatrickDahlin

This is a known issue, see https://github.com/ocornut/imgui/issues/2361

(Also thanks for filling out the entire issue template!)

PathogenDavid avatar Aug 18 '23 23:08 PathogenDavid

I do believe that Vulkan now has ways to request swap simultaneously on multiple swap chains and I wonder if that would at least fix it for affected drivers. Worth trying to implement that.

ocornut avatar Aug 19 '23 08:08 ocornut

I just wanted to provide some information on what I've found that helps reduce/eliminate the node artifacting. If using Vulkan, all window swap chains can be provided in a single present call. This eliminates the framerate issues associated with having multiple undocked windows but doesn't completely eliminate the node artifacting. If the undocked windows are also place earlier in the VkPresentInfoKHR struct so that they are drawn first, this seems to completely eliminates the artifacting. I think as long as the viewport being moved is placed earlier in the VkPresentInfoKHR then the viewport being docked to no artifacting will occur. If the viewport being moved can be easily identified, it can be drawn first each frame and I think that will remove artifacting. It's possible this doesn't completely fix the issue but from testing I haven't seen any artifacting as of yet.

EDIT: I recently updated my NVIDIA graphics drivers to 551.61 and this no longer works, the artifacting is quite bad.

uchytilc avatar Feb 08 '24 16:02 uchytilc