From 8e3520172694d79e9b9f34b85d42ad1252011a74 Mon Sep 17 00:00:00 2001 From: halx99 Date: Thu, 5 Nov 2020 22:51:33 +0800 Subject: [PATCH] fix #255 [ci build] --- cocos/renderer/backend/metal/RenderTargetMTL.mm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cocos/renderer/backend/metal/RenderTargetMTL.mm b/cocos/renderer/backend/metal/RenderTargetMTL.mm index 64701ed21f..5ec92b8561 100644 --- a/cocos/renderer/backend/metal/RenderTargetMTL.mm +++ b/cocos/renderer/backend/metal/RenderTargetMTL.mm @@ -96,7 +96,7 @@ void RenderTargetMTL::applyRenderPassAttachments(const RenderPassParams& params, #endif } - if(bitmask::any(this->_flags, RenderTargetFlag::DEPTH)) { + if(bitmask::any(this->_flags, RenderTargetFlag::DEPTH_AND_STENCIL)) { auto depthAttachment = getDepthAttachment(); if(depthAttachment){ descriptor.depthAttachment.texture = depthAttachment.texture; @@ -106,9 +106,7 @@ void RenderTargetMTL::applyRenderPassAttachments(const RenderPassParams& params, descriptor.depthAttachment.storeAction = getStoreAction(params, TargetBufferFlags::DEPTH); descriptor.depthAttachment.clearDepth = params.clearDepthValue; } - } - - if(bitmask::any(this->_flags, RenderTargetFlag::STENCIL)) { + auto stencilAttachment = getStencilAttachment(); if(stencilAttachment) { descriptor.stencilAttachment.texture = stencilAttachment.texture; @@ -119,6 +117,7 @@ void RenderTargetMTL::applyRenderPassAttachments(const RenderPassParams& params, descriptor.stencilAttachment.clearStencil = params.clearStencilValue; } } + #if 0 if (multisampledDepth) { // We're rendering into our temporary MSAA texture and doing an automatic resolve.