AudioKit / Waveform

GPU accelerated waveform view
MIT License
199 stars 15 forks source link

early return on empty buffer #6

Closed atomhax closed 1 year ago

atomhax commented 1 year ago

This PR is an attempt to address issue #2

My understanding of Metal programming is nascent so please excuse any false presumptions. But from my understanding an early return will solve the issue. In an intensive metal application this might cause some frame skips but in the charting/plotting context I think this will be ok.

Preferably we'd have some sort of feedback up the chain about what caused the error but in the meantime this resolved the issue for my testers.

Notably this issue only happened on iOS 15.6.1 and on an iPhone 12 mini. All the other devices worked perfectly. So it may be an issue with older/slower hardware not having the buffers prepped In time? (I can't believe I'm considering the iPhone 12 old it feels like it just came out yesterday!)