From b855e7dd69b51cd0b4826336c3065fafdb980478 Mon Sep 17 00:00:00 2001 From: David Chavez Date: Sun, 10 Nov 2024 21:39:55 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20store=20and=20resolve=20MSAA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/metal/rt64_metal.mm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/metal/rt64_metal.mm b/src/metal/rt64_metal.mm index 71ab21d..13e701e 100755 --- a/src/metal/rt64_metal.mm +++ b/src/metal/rt64_metal.mm @@ -447,6 +447,11 @@ namespace RT64 { } } + + static MTLClearColor toClearColor(RenderColor color) { + return MTLClearColorMake(color.r, color.g, color.b, color.a); + } + // MetalBuffer MetalBuffer::MetalBuffer(MetalDevice *device, MetalPool *pool, const RenderBufferDesc &desc) { @@ -1256,15 +1261,12 @@ namespace RT64 { if (resolveTo.count(colorAttachment.texture) != 0) { colorAttachment.resolveTexture = resolveTo[colorAttachment.texture]; - colorAttachment.storeAction = MTLStoreActionStoreAndMultisampleResolve; + colorAttachment.storeAction = MTLStoreActionMultisampleResolve; } if (attachmentsToClear.count(i) != 0) { colorAttachment.loadAction = MTLLoadActionClear; - colorAttachment.clearColor = MTLClearColorMake(attachmentsToClear[i].r, - attachmentsToClear[i].g, - attachmentsToClear[i].b, - attachmentsToClear[i].a); + colorAttachment.clearColor = toClearColor(attachmentsToClear[i]); } } @@ -1276,7 +1278,7 @@ namespace RT64 { if (resolveTo.count(depthAttachment.texture) != 0) { depthAttachment.resolveTexture = resolveTo[depthAttachment.texture]; - depthAttachment.storeAction = MTLStoreActionStoreAndMultisampleResolve; + depthAttachment.storeAction = MTLStoreActionMultisampleResolve; } if (depthClearValue >= 0.0) {