I had two experimental code paths with two different problems this morning.
- I could reuse textures over and over again, which would crash intermittently if I was trying to use the texture on two threads (I couldn’t seem to get the locks in all the right places, which I assume is because Apple’s OpenGL implementation likely caches commands for later use).
- I could create new textures every time I needed to upload some buffers into OpenGL. This created a monster memory leak.