Amidst a particularly busy presentation of new technologies at this year's Worldwide Developers Conference, Apple's new graphics technology Metal probably had the most attractive demo, even if its exact benefits were among the most difficult to really understand.
In short: Metal is Apple's new method of programming its graphics processors. The company claims performance gains without hardware changes and also says that games will be more detailed while still rendering at 60 frames per second. It sounds like magic, but it's not: It's the real deal.
The old state of the art
The summary of Metal is that does what it says on the tin--it unlocks the hardware, the "metal," of the A7.
Graphics processors are essentially giant "state machines." Picture a huge board of 1970s-style switches and dials, each labeled with a particular feature. Not all combinations of features are supported by the machine, but you're free to flip the switches anyway. The combination of switches that you've flipped and dials you've tweaked determines the "state of the system."
OpenGL abstracts the hardware for game developers, but means there's a lot of overhead.
The job of the graphics programmer is to flip the right switches, turn the dials just so, and then feed the processor with geometry. This is the sequence that Apple is referring to when it mentions how many more "draw calls" per frame Metal is capable of.
With OpenGL, the current standard for creating graphics, programmers would flip each of these switches and tweak each of these dials individually. Each time they did so, the graphics processor would have to check that the state of the giant machine was still valid.
On the other hand, by using Metal, a programmer can instead define the state they need the machine to be in and then simply apply that state. Rather than tweaking each dial, flipping each switch, and jumping through the correct hoops, the process becomes more like checking off your sushi order from a menu.
Metal lets game developers more easily get the benefits of the hardware the device is using.
From a user's perspective, none of these particular details matter. The ramifications, however, will definitely be noticed.
The magic of Metal
Metal is designed around how GPUs and CPUs work today, especially (and specifically) when it comes to Apple's A7. The A7 combines the GPU and CPU into one chip, and they also share a single memory pool.
Much of OpenGL is predicated on the notion that the GPU is (or could be) sitting on a separate card. By recognizing the fact that the GPU and CPU can access the same memory Metal unlocks a lot of power. Managing resources needed for drawing becomes vastly easier and faster. Many effects, such as reflections, require drawing the scene into an image and then using that image as an input in the final scene. Metal makes that far easier.
Sign up for MIS Asia eNewsletters.