Skip to content

Commit

Permalink
Merge pull request #1086 from cdavis5e/layered-copies-availability
Browse files Browse the repository at this point in the history
MVKCmdCopyImage: Only use the multi-layer copy method if available.
  • Loading branch information
billhollings authored Oct 1, 2020
2 parents a31d87f + d6294a1 commit b9b78de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MoltenVK/MoltenVK/Commands/MVKCmdTransfer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ static inline MTLSize mvkClampMTLSize(MTLSize size, MTLOrigin origin, MTLSize ma
VkExtent3D dstExtent = _dstImage->getExtent3D(dstPlaneIndex, dstLevel);
// If the extent completely covers both images, I can copy all layers at once.
// This will obviously not apply to copies between a 3D and 2D image.
if (mvkVkExtent3DsAreEqual(srcExtent, vkIC.extent) && mvkVkExtent3DsAreEqual(dstExtent, vkIC.extent)) {
if (mvkVkExtent3DsAreEqual(srcExtent, vkIC.extent) && mvkVkExtent3DsAreEqual(dstExtent, vkIC.extent) &&
[mtlBlitEnc respondsToSelector: @selector(copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount:)]) {
assert((_srcImage->getMTLTextureType() == MTLTextureType3D) == (_dstImage->getMTLTextureType() == MTLTextureType3D));
[mtlBlitEnc copyFromTexture: srcMTLTex
sourceSlice: srcBaseLayer
Expand Down

0 comments on commit b9b78de

Please sign in to comment.