From 9ed9c0a9e4eb75da4f2ce85fdf3e3af6484fef0d Mon Sep 17 00:00:00 2001 From: rogerman Date: Fri, 13 May 2022 15:53:13 -0700 Subject: [PATCH] Cocoa Port: Use MTLPixelFormatBGRA8Unorm pixel format for all Metal display view pipeline descriptors in order to stop dev+ builds from assert crashing themselves under some very rare and specific situations. --- .../src/frontend/cocoa/userinterface/MacMetalDisplayView.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/desmume/src/frontend/cocoa/userinterface/MacMetalDisplayView.mm b/desmume/src/frontend/cocoa/userinterface/MacMetalDisplayView.mm index 46840f0a9..f9ae0a244 100644 --- a/desmume/src/frontend/cocoa/userinterface/MacMetalDisplayView.mm +++ b/desmume/src/frontend/cocoa/userinterface/MacMetalDisplayView.mm @@ -190,7 +190,7 @@ [[[hudPipelineDesc colorAttachments] objectAtIndexedSubscript:0] setPixelFormat:MTLPixelFormatBGRA8Unorm]; hudPipeline = [[device newRenderPipelineStateWithDescriptor:hudPipelineDesc error:nil] retain]; - [[[hudPipelineDesc colorAttachments] objectAtIndexedSubscript:0] setPixelFormat:MTLPixelFormatRGBA8Unorm]; + [[[hudPipelineDesc colorAttachments] objectAtIndexedSubscript:0] setPixelFormat:MTLPixelFormatBGRA8Unorm]; hudRGBAPipeline = [[device newRenderPipelineStateWithDescriptor:hudPipelineDesc error:nil] retain]; [hudPipelineDesc release]; @@ -1180,7 +1180,7 @@ break; } - [[[outputPipelineDesc colorAttachments] objectAtIndexedSubscript:0] setPixelFormat:MTLPixelFormatRGBA8Unorm]; + [[[outputPipelineDesc colorAttachments] objectAtIndexedSubscript:0] setPixelFormat:MTLPixelFormatBGRA8Unorm]; [self setOutputRGBAPipeline:[[sharedData device] newRenderPipelineStateWithDescriptor:outputPipelineDesc error:nil]]; if ([self drawableFormat] != MTLPixelFormatInvalid) @@ -1226,7 +1226,7 @@ } #endif - [[[outputPipelineDesc colorAttachments] objectAtIndexedSubscript:0] setPixelFormat:MTLPixelFormatRGBA8Unorm]; + [[[outputPipelineDesc colorAttachments] objectAtIndexedSubscript:0] setPixelFormat:MTLPixelFormatBGRA8Unorm]; outputRGBAPipeline = [[[sharedData device] newRenderPipelineStateWithDescriptor:outputPipelineDesc error:nil] retain]; if ([self drawableFormat] != MTLPixelFormatInvalid)