GPU Capture Button Flickering

October 28, 2019

One of the "Things I Don't Know" in the iOS ecosystem is Metal. As such, I've been working through Metal By Example recently, which still stands as a great introduction to Metal. Invariably I've hit issues debugging my shader pipelines, and GPU Frame Capture has been a really invaluable tool.

One weird thing I noticed was that in the examples I was writing, the camera button in Xcode which enables GPU Frame Capture would flicker, making it really hard to click:

GIF showing the camera button flickering

After puzzling over this for a while, Warren Moore, who wrote the book (!) reached out on Twitter to note that this might happen because I was calling the device's makeCommandQueue every frame, when really I should be creating one up front and saving it.

It worked, and now the flicker doesn't happen anymore! 🎉

Picture of me with a corgi

Noah Gilmore

Hello! I'm Noah, a software developer based in the San Francisco bay area. I focus mainly on iOS, Apple platform development, and full stack web development.

  • 💻 I'm writing a macOS editor for Atlassian Confluence called Fluency
  • 📱 I wrote an app which lets you create transparent app icons called Transparent App Icons
  • 🧩 I made a puzzle game for iPhone and iPad called Trestle
  • 🎨 I wrote a CoreImage filter utility app for iOS developers called CIFilter.io
  • 👋 Please feel free to reach out on Twitter