Hacker News new | ask | show | jobs
by winterismute 1095 days ago
Metal is a modern - and under many points of view, pretty good - rendering API that allows you, for example, to declare the rendering pipelines/dispatches fully without you having to call multiple "change_state" in your CPU code (similar to DX12, Vulkan etc). This means the GPU can run "flat out" and that a driver can be pretty lean and introduce little overhead (if done well enough).

In more advanced cases when many API commands need to be encoded depending on users' input, and if batching is not enough, you can use things like "MTLParallelRenderCommandEncoder" and multiple queues to take adavantage of multiple threads submitting such commands.

This all means that "pushing the envelope" in terms of rendering is absolutely possible despite the possibly small overhead added by Obj-C - which however also brings some advantages as it often avoids having to call "free" on GPU memory since the MTLBuffers are reference-counted.