Skip to content

Debugging

Phawit Pornwattanakul edited this page Jun 19, 2026 · 2 revisions

Debugging Metal Renderer Performance

Sakura's Metal renderer can display Apple's Metal Performance HUD for measure performance using tool that Apple provided like in Xcode.

The HUD will be drawn in CAMetalLayer at the top-right of window.

Metal HUD

All environment variable that Apple provided should be work, see customization and list of envvar in documentation

Usage

Enable HUD

MTL_HUD_ENABLED=1 dotnet run

Add per-metric flag e.g. encoder GPU timing

MTL_HUD_ENABLED=1 MTL_HUD_ENCODER_TIMING_ENABLED=1 dotnet run

Clone this wiki locally