Chapter 19 - Challenge Error

Hi.

I am trying the challenge on Chapter 19 and it gets me the next error:

-[MTLDebugRenderCommandEncoder validateFramebufferWithRenderPipelineState:]:946: failed assertion `For color attachment 0, the render pipeline’s pixelFormat (MTLPixelFormatRGBA8Unorm_sRGB) does not match the framebuffer’s pixelFormat (MTLPixelFormatBGR10_XR_sRGB).’

Any suggestions?

Ok.

It seems that the problem is related to the transition. I tried change the next code:

  scnView.present(gameScene, with: transition, incomingPointOfView: nil) {
     self.game.state = .Playing
     self.setupSounds()
     self.gameScene.isPaused = false
  }

for this one:

  scnView.scene = gameScene
  game.state = .Playing
  setupSounds()
  gameScene.isPaused = false

and everything worked. It seems like it’s an Apple problem but if you know other way to use the Transitions, I’d appreciate your suggestion.

Jut learned that disabling the Metal API Validation (in Edit Scheme > Options) solves this issue. Not sure what the drawbacks are.

2 Likes

Great workaround man. You made my day!
Hopefully Apple fixes this thing asap.