Browse Source

metal: don't do auto sRGB -> P3 color conversions on the backbuffer

Alex Szpakowski 3 years ago
parent
commit
19feec43f9
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/modules/graphics/metal/Graphics.mm

+ 6 - 0
src/modules/graphics/metal/Graphics.mm

@@ -469,6 +469,12 @@ bool Graphics::setMode(void *context, int width, int height, int pixelwidth, int
 	metalLayer.device = device;
 	metalLayer.device = device;
 	metalLayer.pixelFormat = isGammaCorrect() ? MTLPixelFormatBGRA8Unorm_sRGB : MTLPixelFormatBGRA8Unorm;
 	metalLayer.pixelFormat = isGammaCorrect() ? MTLPixelFormatBGRA8Unorm_sRGB : MTLPixelFormatBGRA8Unorm;
 
 
+	// Explicitly turn off color matching, for now (eg don't make sRGB content
+	// appear correct on P3 displays). It looks better with color matching, but
+	// having it off matches the OpenGL backend and there's some cost to it.
+	// TODO: revisit this?
+	metalLayer.colorspace = nil;
+
 	// This is set to NO when there are pending screen captures.
 	// This is set to NO when there are pending screen captures.
 	metalLayer.framebufferOnly = YES;
 	metalLayer.framebufferOnly = YES;