Xcode 16: Errata for Metal by Tutorials 4th Edition

Creating this topic to list any changes that Xcode 16 has brought us.

Problem: uint doesn’t compile.

Solution: Change uint to uint32_t. Or at the top of Common.h, add typedef uint32_t uint;

In the bridging header, I often use uint. This does not now compile, as the module isn’t included.

The Metal Shading Language Specification includes uint to be the same as uint32_t, so I think it this this is an oversight. If you use typedef... be prepared to remove it at a future Xcode release.

Or if anyone knows which module should be included, please let me know :slight_smile:

3 Likes

Problem: var quaternion = simd_quatf(.identity) doesn’t compile. (Chapter 23 forward)

Solution: Add this to MathLibrary.swift:

extension simd_quatf {
  static var identity: simd_quatf {
    .init(angle: 0, axis: [1, 0, 0])
  }
}

In Transform.swift, change:

var quaternion = simd_quatf(.identity)
to
var quaternion: simd_quatf = .identity

In AnimationClip.swift, change:

jointAnimation.getRotation(at: time) ?? simd_quatf(.identity)
to
jointAnimation.getRotation(at: time) ?? simd_quatf.identity

1 Like