MVKImage: Always set the depth plane when rendering to a 3D image.

Even if we used a texture view. We can't constrain the depth planes in a
3D texture using a texture view, so we need to set the render depth
plane in that case.
This commit is contained in:
Chip Davis 2020-10-21 09:57:30 -05:00
parent 59ab58484a
commit b052600404

View File

@ -1537,7 +1537,7 @@ void MVKImageView::populateMTLRenderPassAttachmentDescriptor(MTLRenderPassAttach
mtlAttDesc.level = plane->_useMTLTextureView ? 0 : _subresourceRange.baseMipLevel;
if (mtlAttDesc.texture.textureType == MTLTextureType3D) {
mtlAttDesc.slice = 0;
mtlAttDesc.depthPlane = plane->_useMTLTextureView ? 0 : _subresourceRange.baseArrayLayer;
mtlAttDesc.depthPlane = _subresourceRange.baseArrayLayer;
} else {
mtlAttDesc.slice = plane->_useMTLTextureView ? 0 : _subresourceRange.baseArrayLayer;
mtlAttDesc.depthPlane = 0;