Skip to content

MacOS Implementation and Metal

date: 07/17/2026

AnvilEngine now supports MacOS (to an extent) via the Metal graphics API.

Over the past several commits, the Metal backend has gone from a proof of concept into a functional renderer capable of driving the editor. While it still trails Vulkan in overall features, the architecture between both rendering APIs is now much closer than when the port began.

Metal Renderer

The Metal renderer now follows the same abstraction layer used by Vulkan. Rather than implementing editor-specific rendering paths, both APIs share the same high-level rendering interface while providing platform-specific implementations underneath.

Current Metal platform components include:

  • MetalContext
  • MetalRenderAPI
  • MetalRenderTarget
  • Command encoding through MTLCommandBuffer and MTLRenderCommandEncoder

Keeping both backends architecturally similar should make future features significantly easier to implement, since most rendering code can now remain API-agnostic.

One of the larger milestones was implementing Metal render targets.

Instead of rendering directly to the window, the editor can now render into offscreen textures before displaying the results inside ImGui. This matches the behavior of the Vulkan backend and allows the Scene viewport to function identically across platforms.

With render targets in place, future systems like:

  • Framebuffers
  • Post-processing
  • Multiple editor viewports
  • Shadow maps
  • Reflection rendering

will all build upon the same abstraction.

The editor viewport now renders correctly using Metal instead of displaying the infamous pink placeholder screen.

Getting to this point involved solving several platform-specific issues, including:

  • CAMetalLayer configuration
  • Drawable presentation
  • Texture lifetime management
  • Command buffer synchronization
  • Render pass setup

Although there are still visual issues to iron out, the editor is finally rendering real scene data through Metal.

One of the major goals of the port has been reducing the amount of renderer-specific code.

Rather than adding special cases throughout the engine, effort has been spent bringing Metal up to feature parity with Vulkan. This allows new rendering features to be implemented once and exposed through both graphics APIs.

There’s still work remaining before the two renderers are truly equivalent, but the gap is becoming much smaller.

  • Cross-platform shader pipeline (GLSL → SPIR-V → MSL)

Some immediate goals include:

  • Texture support
  • Sprite rendering improvements
  • Rotation and Z-order
  • Runtime shader compilation
  • Scene play mode
  • Audio system

Mac support is still considered experimental, but each commit brings it closer to becoming a first-class platform alongside Vulkan.