I got a bug where I was updating textures instead of creating new ones, which led to quite strange behavior. A simple check whether the dimensions are correct could avoid this. One idea is to have a safe method that checks the texture size and another unsafe method for faster updates.