From 778992face67ecefaa5c2932db4b2101545ea4df Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 7 Oct 2026 20:36:32 +0200 Subject: [PATCH] Backends: Metal, Metal4: fixed build for multi-viewports. Amend 5cf9cef. (#9574) --- backends/imgui_impl_metal.mm | 2 +- backends/imgui_impl_metal4.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/imgui_impl_metal.mm b/backends/imgui_impl_metal.mm index b89797647..881e62178 100644 --- a/backends/imgui_impl_metal.mm +++ b/backends/imgui_impl_metal.mm @@ -517,7 +517,7 @@ static void ImGui_ImplMetal_CreateWindow(ImGuiViewport* viewport) CAMetalLayer* layer = [CAMetalLayer layer]; layer.device = device; layer.framebufferOnly = YES; - layer.pixelFormat = bd->SharedMetalContext.framebufferDescriptor.colorPixelFormats[0]; + layer.pixelFormat = [bd->SharedMetalContext.framebufferDescriptor colorPixelFormatAtIndex:0]; #if TARGET_OS_OSX NSWindow* window = (__bridge NSWindow*)handle; NSView* view = window.contentView; diff --git a/backends/imgui_impl_metal4.mm b/backends/imgui_impl_metal4.mm index a042a1bcb..6c9603afc 100644 --- a/backends/imgui_impl_metal4.mm +++ b/backends/imgui_impl_metal4.mm @@ -840,7 +840,7 @@ static void ImGui_ImplMetal_CreateWindow(ImGuiViewport* viewport) CAMetalLayer* layer = [CAMetalLayer layer]; layer.device = device; layer.framebufferOnly = YES; - layer.pixelFormat = bd->SharedMetalContext.framebufferDescriptor.colorPixelFormats[0]; + layer.pixelFormat = [bd->SharedMetalContext.framebufferDescriptor colorPixelFormatAtIndex:0]; #if TARGET_OS_OSX NSWindow* window = (__bridge NSWindow*)handle; NSView* view = window.contentView;