i’m using this function to load ETC2 texture from KTX on the iOS platform. The KTX texture was converted from jpg with PVRTex tool: PVRTexToolCLI.exe -i tex.jpg -o tex.ktx -f ETC2_RGB -q etcfast -m 9
Get the error:
[MTLDebugBlitCommandEncoder
validateCopyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:options:]:463: failed assertion `sourceOffset (4) must be a multiple of 8 bytes.’
size of texture is 1024 * 1024, with VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK format.
From the Metal document:
The byte location in the source buffer where the copying starts. The location must be aligned to the size of the destination texture's pixel format. The value must be a multiple of the destination texture's pixel size, in bytes.
Does it mean my sourceOffset should be a multiple of 3 bytes(R8G8B8)?
And when i use ASTC_6x6 format, got error: `sourceOffset (4) must be a multiple of 16 bytes.’