From 5dec8b90056d611e5397b2c11b05db8ba6e9e2d8 Mon Sep 17 00:00:00 2001 From: Greg Wells Date: Fri, 6 Jun 2025 17:13:23 -0400 Subject: [PATCH] fix CAMetalLyer problem --- src/platform/platform_macos/gryphn_platform_macos.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/platform/platform_macos/gryphn_platform_macos.m b/src/platform/platform_macos/gryphn_platform_macos.m index 31324cf..99f5e5f 100644 --- a/src/platform/platform_macos/gryphn_platform_macos.m +++ b/src/platform/platform_macos/gryphn_platform_macos.m @@ -49,11 +49,12 @@ void gnWindowSetMTKView(NSWindow* window, MTKView* view) { } CAMetalLayer* gnCreateCAMetalLayer(NSWindow* window) { + NSView* view = window.contentView; CAMetalLayer* layer = [CAMetalLayer layer]; - layer.pixelFormat = MTLPixelFormatBGRA8Unorm; - layer.frame = window.contentView.layer.bounds; - window.contentView.wantsLayer = YES; - window.contentView.layer = layer; + [layer setContentsScale:[window backingScaleFactor]]; + [layer setFramebufferOnly:YES]; + [view setLayer:layer]; + [view setWantsLayer:YES]; return layer; }