There are 2 OpenGLES2 contexts, that are is same "share group". I know that it's possible to upload texture in worker thread while it's not being used in render thread. But is it possible to upload portion of data to a region on atlas texture from worker thread and sample from same atlas texture (but from different region, of course)? I've read that rendering to a texture and sampling it will lead to undefined behavior (unless using NV_texture_fence), but it's not actually my case.
No, that breaks the 1st and 2nd rules from the docs:
It is your application’s responsibility to manage state changes to OpenGL ES objects when the sharegroup is shared by multiple contexts. Here are the rules:
- Your application may access the object across multiple contexts simultaneously provided the object is not being modified.
- While the object is being modified by commands sent to a context, the object must not be read or modified on any other context.
- After an object has been modified, all contexts must rebind the object to see the changes. The contents of the object are undefined if a context references it before binding it.