- Due to the fact that map::insert doesn't allow to insert an element by...

Due to the fact that map::insert doesn't allow to insert an element by existing key, I suggest to use operator []. It allows to change the cached value, very helpful on Android platform: when context is lost, the application will reset - rebuild - recache all it's shaders.