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

This commit is contained in:
Stephen H. Gerstacker 2022-06-30 20:19:23 +02:00 committed by ocornut
parent 5d0deebba4
commit ad5aa54166

View File

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