Group Group Group Group Group Group Group Group Group

Chapter 7 hangs GPU on iOS

#1

Hey Guys,

after following instructions in Chapter 7 to see the normal map applied to the cottage, the GPU hangs when executing on iOS, while running fine with no errors executing on macOS.

I assume that there is no “big” mistake in the code, but maybe there has something to change from macOS to iOS that the GPU will throw no error and will continue working?

#2

@fuhunter - That’s an interesting find. Thank you for picking it up.

You may have noticed Execution of the command buffer was aborted due to an error during execution. Caused GPU Hang Error (IOAF code 3) in the console. These errors can be hard to overcome.

Fortunately this one is an easy fix. It’s interesting that it works on macOS and not iOS. I would have thought that it shouldn’t work at all.

In cottage1.mtl, the glass group doesn’t have a normal texture associated with it.

Copy

map_tangentSpaceNormal cottage-normal

to just above map_Kd cottage-color in the glass group.

This should work. The shader was looking for a normal texture for that fragment but couldn’t find one.

#3

At first I thought there is a mistake in Shadrs.metal, because commenting out our normal calculations displayed the cottage again, but after compiling without any errors for MacOS I knew this couldn’ Be the problem.

Yeah this was the error code I got (thought wow so much detail), I’ll try your solution when I get back home.