Merge pull request #296 from cdavis5e/copy-image-compat-format

vkCmdCopyImage: Allow copies between compatible formats.
This commit is contained in:
Bill Hollings 2018-10-03 13:14:35 -04:00 committed by GitHub
commit 4640d273af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,12 +59,9 @@ void MVKCmdCopyImage::setContent(VkImage srcImage,
// Validate
clearConfigurationResult();
if (_srcImage->getMTLPixelFormat() != _dstImage->getMTLPixelFormat()) {
setConfigurationResult(mvkNotifyErrorWithText(VK_ERROR_FEATURE_NOT_PRESENT, "vkCmdCopyImage(): The source and destination images must have the same format."));
if ((_srcImage->getMTLTextureType() == MTLTextureType3D) != (_dstImage->getMTLTextureType() == MTLTextureType3D)) {
setConfigurationResult(mvkNotifyErrorWithText(VK_ERROR_FEATURE_NOT_PRESENT, "vkCmdCopyImage(): Metal does not support copying to or from slices of a 3D texture."));
}
if ((_srcImage->getMTLTextureType() == MTLTextureType3D) || (_dstImage->getMTLTextureType() == MTLTextureType3D)) {
setConfigurationResult(mvkNotifyErrorWithText(VK_ERROR_FEATURE_NOT_PRESENT, "vkCmdCopyImage(): Metal does not support copying to or from slices of a 3D texture."));
}
}
// Adds a Metal copy region structure for each layer in the specified copy region.