I'm trying to use MPSImageIntegral to sum the values in a 1D UInt32 buffer. My source buffer has been snapped to 64-byte row alignment, as has my destination buffer. Both buffers use .storageModeShared and the textures that wrap them both use the .r32Uint pixel format.
When I attempt to encode a image integral to sum up the ints in the source buffer into the first element of the destination, I get:
/BuildRoot/Library/Caches/com.apple.xbs/Sources/MetalImage/MetalImage-61.4/MetalPerformanceShaders/Filters/MPSIntegral.mm:109: failed assertion `Destination 0x174116770 texture format does not match source 0x1741160b0 texture format
If I `po` the two textures and diff the results, I get very few differences, and nothing that seems like it would be incompatible:
1c1
< <MTLDebugTexture: 0x1741160b0> -> <AGXA8Texture: 0x101333220>
---
> <MTLDebugTexture: 0x174116770> -> <AGXA8Texture: 0x101333e60>
5c5
< width = 1920
---
> width = 1
20c20
< buffer = <AGXA8Buffer: 0x101332be0>
---
> buffer = <AGXA8Buffer: 0x1013330e0>
22,23c22,23
< bufferBytesPerRow = 7680
< -> <MTLTextureDescriptorInternal: 0x17400de80>
---
> bufferBytesPerRow = 64
> -> <MTLTextureDescriptorInternal: 0x17400e130>
38c38
< width = 1920;
---
> width = 1;
40,41c40,41
< buffer = "<MTLDebugBuffer: 0x1740fe980> -> <AGXA8Buffer: 0x101332be0> -> {\n label = \"<null>\";\n length = 7680;\n options = \"MTLResourceCPUCacheModeDefaultCache MTLResourceStorageModeShared \";\n purgeableState = MTLPurgeableStateNonVolatile;\n}";
< bufferBytesPerRow = 7680;
---
> buffer = "<MTLDebugBuffer: 0x1740fed80> -> <AGXA8Buffer: 0x1013330e0> -> {\n label = \"<null>\";\n length = 256;\n options = \"MTLResourceCPUCacheModeDefaultCache MTLResourceStorageModeShared \";\n purgeableState = MTLPurgeableStateNonVolatile;\n}";
> bufferBytesPerRow = 64;
Am I missing something here? Is the error message referring to something else?