fix #255 [ci build]

This commit is contained in:
halx99 2020-11-05 22:24:30 +08:00
parent 09fbf76bf5
commit fefb5f27fb
1 changed files with 20 additions and 16 deletions

View File

@ -96,24 +96,28 @@ void RenderTargetMTL::applyRenderPassAttachments(const RenderPassParams& params,
#endif
}
auto depthAttachment = getDepthAttachment();
if(depthAttachment){
descriptor.depthAttachment.texture = depthAttachment.texture;
descriptor.depthAttachment.level = depthAttachment.level;
// descriptor.depthAttachment.slice = depthAttachment.layer;
descriptor.depthAttachment.loadAction = getLoadAction(params, TargetBufferFlags::DEPTH);
descriptor.depthAttachment.storeAction = getStoreAction(params, TargetBufferFlags::DEPTH);
descriptor.depthAttachment.clearDepth = params.clearDepthValue;
if(bitmask::any(this->_flags, RenderTargetFlag::DEPTH)) {
auto depthAttachment = getDepthAttachment();
if(depthAttachment){
descriptor.depthAttachment.texture = depthAttachment.texture;
descriptor.depthAttachment.level = depthAttachment.level;
// descriptor.depthAttachment.slice = depthAttachment.layer;
descriptor.depthAttachment.loadAction = getLoadAction(params, TargetBufferFlags::DEPTH);
descriptor.depthAttachment.storeAction = getStoreAction(params, TargetBufferFlags::DEPTH);
descriptor.depthAttachment.clearDepth = params.clearDepthValue;
}
}
auto stencilAttachment = getStencilAttachment();
if(stencilAttachment) {
descriptor.stencilAttachment.texture = stencilAttachment.texture;
descriptor.stencilAttachment.level = depthAttachment.level;
// descriptor.stencilAttachment.slice = depthAttachment.layer;
descriptor.stencilAttachment.loadAction = getLoadAction(params, TargetBufferFlags::STENCIL);
descriptor.stencilAttachment.storeAction = getStoreAction(params, TargetBufferFlags::STENCIL);
descriptor.stencilAttachment.clearStencil= params.clearStencilValue;
if(bitmask::any(this->_flags, RenderTargetFlag::STENCIL)) {
auto stencilAttachment = getStencilAttachment();
if(stencilAttachment) {
descriptor.stencilAttachment.texture = stencilAttachment.texture;
descriptor.stencilAttachment.level = stencilAttachment.level;
// descriptor.stencilAttachment.slice = depthAttachment.layer;
descriptor.stencilAttachment.loadAction = getLoadAction(params, TargetBufferFlags::STENCIL);
descriptor.stencilAttachment.storeAction = getStoreAction(params, TargetBufferFlags::STENCIL);
descriptor.stencilAttachment.clearStencil = params.clearStencilValue;
}
}
#if 0
if (multisampledDepth) {