I'm experiencing 100% reproducible bug with Xcode. It took me days to figure it out. After many tears shed.
Xcode is producing a corrupt binary. It seems like my metal buffers are being mis-aligned or something.
The problem showed up after changing the Deployment to iOS 15. It had been at iOS 13 and built and ran without any related issues - for years that I've been developing this app.
So at some point after changing the target to iOS 15, compiling the shaders went from about 0.001 seconds to 30 seconds. When that happens, the GPU will also hang with the messages:
GPUDebug] Invalid device load executing kernel function "computeArtPointsToRender" encoder: "0", dispatch: 0, at offset 22080048
Shaders.metal:1290:41 - computeArtPointsToRender()
To fix the issue, I have to change the build target to iOS 13, clean, build, change to iOS 15, clean, build and then works again as expected (until it doesn't at some random point or until I have restarted the machine).
This is 100% reproducible:
Restart mac
Build project
Issue occurs
Change build target to iOS 13
Clean build folder
Build
Change build target to iOS 15
Delete derived files
Build
Works as expected
Xcode: Version 13.1 (13A1030d)
macOS: 11.5.2 (20G95)
Mac mini (M1, 2020)
In my 11+ years as a full time iOS developer, I've never encountered such a serious issue with Xcode. If I don't have stable tools, it is impossible for me to develop.
3
0
2.3k