MTLBlitCommandEncoder copy PVRTC from buffer to texture corrupts content

In trying to copy PVRTC texture data from a buffer to a texture using

copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture: destinationSlice:destinationLevel:destinationOrigin:options:

with the option

MTLBlitOptionRowLinearPVRTC


the PVRTC image content is corrupted if the correct value is provided for sourceBytesPerRow: and sourceBytesPerImage:.


However...if sourceBytesPerRow: and sourceBytesPerImage: are set to 0 (as demanded by the equivalent replaceRegion method) the image content IS COPIED CORRECTLY. However...when setting those values to 0...Metal throws validation assertion about the row byte width.


It seems to me that Metal should either demand that 0 be set for those two values (as with replaceRegion)...and validate correctly...OR accept the correct values and copy accurately.


I've uploaded an Xcode project that demonstrates the issue.


Line 980 of MBETextureDataSource.m...where bytesPerRow is set to 0...will trigger the validation assertion. But if Metal validation is disabled in the Xcode schema...the image content is copied correctly. Commenting out that line will stop the validation assertion...but wil not copy the content correctly.