Browse Source

Backends, Viewport: Metal: Pull format from shared context. (#5403, #5437)

Stephen H. Gerstacker 3 years ago
parent
commit
ad5aa54166
1 changed files with 1 additions and 1 deletions
  1. 1 1
      backends/imgui_impl_metal.mm

+ 1 - 1
backends/imgui_impl_metal.mm

@@ -413,7 +413,7 @@ static void ImGui_ImplMetal_CreateWindow(ImGuiViewport* viewport)
     CAMetalLayer* layer = [CAMetalLayer layer];
     layer.device = device;
     layer.framebufferOnly = YES;
-    layer.pixelFormat = MTLPixelFormatBGRA8Unorm;
+    layer.pixelFormat = bd->SharedMetalContext.framebufferDescriptor.colorPixelFormat;
 #if TARGET_OS_OSX
     NSWindow* window = (__bridge NSWindow*)handle;
     NSView* view = window.contentView;