mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-16 19:11:13 +00:00
Backends: Metal4: vertex/index buffers of a viewport are overwritten by the next viewport rendered in the same frame #9625
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#9625
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version/Branch of Dear ImGui:
Version 1.93.1 WIP, Branch: docking (
cf53467ab)Back-ends:
imgui_impl_sdl3.cpp + imgui_impl_metal4.mm
Compiler, OS:
macOS 27.0.1 (Apple Silicon) + Apple Clang 21
Full config/build information:
No response
Details:
My Issue/Question:
With multi-viewports, a viewport can be rendered with the geometry of a viewport rendered after it in the same frame. In our application (many viewports) contents are scrambled and menus flicker in and out.
ImGui_ImplMetal4_RenderDrawData()puts its vertex and index buffers back intobufferCaches[slot]right after encoding, so the nextImGui_ImplMetal4_RenderDrawData()of the same frame dequeues the same buffers and overwrites them before the GPU has executed the previous command buffer. The Metal backend returns them in the command buffer's completed handler.Reproduces in example_sdl3_metal4 with the code below and
#define FRAMES_IN_FLIGHT 1(with the default 3 it freezes first, see #9621). I compared every presented frame of the main window with a second render of the sameImDrawDatamade once the GPU is idle: they differ in 123 to 230 of 230 frames depending on the run, and in 0 of 230 with the fix.Fix proposed in #9622.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code: