GPU Capture Button Flickering

October 27, 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! 🎉

Tweet This
Get New Posts Via Email
Picture of me with a corgi

Noah Gilmore

I'm Noah, a software developer based in the San Francisco Bay Area. I focus mainly on full stack web and iOS development

  • 💻 I co-founded Replo, a no-code platform for e-commmerce
  • ✍️ You can read technical posts on my blog
  • 📱 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 / 𝕏