How often should CVMetalTextureCache be flushed?

Viewed 441

I'm using CVMetalTextureCacheCreateTextureFromImage to create metal textures from CVPixelBuffers. In CVMetalTextureCache.h, there is a method called CVMetalTextureCacheFlush that has the following comment attached to it:

CVMetalTextureCacheFlush:

  • Performs internal housekeeping/recycling operations

  • This call must be made periodically to give the texture cache a chance to do internal housekeeping operations.

Roughly speaking, how frequently is "periodically" implying? Do I have to call flush after every 'n' calls to CreateTextureFromImage? Is it every other call? Every 10 calls? Every 100 calls? Or is it time based like every second or so?

I assume the texture cache has some resource limitations and needs to reclaim resources or old textures from time-to-time, but it's unclear to me how frequently flush needs to get called within an application.

0 Answers
Related