I have some code that used to run on my iPad Pro. Today I compiled it for iOS 13, with Xcode 11, and I get errors like this:
validateComputeFunctionArguments:834: failed assertion `Compute Function(merge_layer):
Shader uses texture(outTexture[1]) as read-write, but hardware does not support read-write texture of this pixel format.'
The pixel format is showing as `MTLPixelFormatBGRA8Unorm`. That's what I expected.
The debugger says the device has no support for writeable textures.
(lldb) p device.readWriteTextureSupport
(MTLReadWriteTextureTier) $R25 = tierNone
Did some devices lose support for texture writing in iOS 13?
Rob
According to developer tech support, the current behavior is correct. Some of these devices, like 2nd generation iPad Pro, don't support read-write textures. I was a little confused that they wouldn't admit that it was behaving differently before, but I don't have time to do all the extra work to prove that to them.
You can see the "function texture read-write" feature in the Metal feature table here: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
You can detect the function texture read-write support like this:
if #available(iOS 11, *) {
if self.device.supportsFamily(.common3) || self.device.supportsFamily(.apple4) {
print("supported")
} else {
print("not supported")
}
} else {
print("Needs iOS 11 or higher")
}