I found the issue, but I donāt know yet why there is an issue - the problem is not with the gpu or the metal pipeline at all. Itās Model I/O:
let asset = MDLAsset(
url: assetURL,
vertexDescriptor: .defaultLayout,
bufferAllocator: allocator)
On the iOS simulator this works fine, but on macOS it fails to fully populate the texture coordinate buffer - it correctly writes the first few coordinates but leaves most of them at (0, 0). I checked first using Capture GPU Workload, then added added a print loop right after the MDLAsset constructor to make sure they were not getting lost downstream (they arenāt):
// iOS Simulator texture coordinates
loaded texture: lowpoly-house-color.png
SIMD2(0.219114, 0.652658)
SIMD2(0.023366, 0.652658)
SIMD2(0.023366, 0.347341)
SIMD2(0.219114, 0.347341)
SIMD2(0.334651, 0.347341)
SIMD2(0.334651, 0.000113)
SIMD2(0.450188, 0.151593)
SIMD2(0.450188, 0.347341)
SIMD2(0.450188, 0.347341)
SIMD2(0.645937, 0.347341)
SIMD2(0.645937, 0.652658)
SIMD2(0.450188, 0.652658)
SIMD2(0.334651, 0.652658)
SIMD2(0.334651, 0.999887)
SIMD2(0.219114, 0.848407)
SIMD2(0.219114, 0.652658)
SIMD2(0.334651, 0.347341)
SIMD2(0.450188, 0.347341)
SIMD2(0.450188, 0.652658)
SIMD2(0.334651, 0.652658)
SIMD2(0.984034, 0.792101)
SIMD2(0.984034, 0.982614)
SIMD2(0.678717, 0.982614)
SIMD2(0.678717, 0.792102)
SIMD2(0.984034, 0.601589)
SIMD2(0.984034, 0.792101)
SIMD2(0.678717, 0.792102)
SIMD2(0.678717, 0.601589)
SIMD2(0.219114, 0.347341)
SIMD2(0.219114, 0.652658)
SIMD2(0.450188, 0.652658)
SIMD2(0.450188, 0.848407)
SIMD2(0.219114, 0.347341)
SIMD2(0.219115, 0.151593)
// macOS Simulator texture coordinates
loaded texture: lowpoly-house-color.png
SIMD2(0.219114, 0.652658)
SIMD2(0.023366, 0.652658)
SIMD2(0.023366, 0.347341)
SIMD2(0.219114, 0.347341)
SIMD2(0.334651, 0.347341)
SIMD2(0.334651, 0.000113)
SIMD2(0.450188, 0.151593)
SIMD2(0.450188, 0.347341)
SIMD2(0.450188, 0.347341)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
SIMD2(0.0, 0.0)
Strange! Other complex texture mapping apps - like the ModernRenderingWithMetal example from apple - work fine on this machine, but they are not using Model I/O.