Loading data into a texture Atlas in a background thread (OpenGL ES 2.0)

There are 2 context. One is used for rendering in the main thread, the second to load textures in the background. If you don't use atlases, then the difficulties will not arise, because the texture doesn't appeal at the time of writing it 100%. But if I need to update the map, but to draw from the same Atlas, but other areas — I'll perform the act of stepping on a rake, or everything goes smoothly?
October 3rd 19 at 02:27
1 answer
October 3rd 19 at 02:29
Depends on which platform (iOS\Android and the GPU model) is, in principle, iOS devices video memory and RAM are combined in one chip, because if you map\unmap get a pointer through which you can safely write. You can try to just do in the forehead: two contexts, the Atlas between them which first draws, the second one updates its data. It can be a little more complicated: using GL_APPLE_sync to create a synchronization point when the Atlas we have drawn, and to fill the data only when not in use. Or even clumsy solution: make two copies of the Atlas to draw first, pour the second, then swap them.

ps. Can I have a texture which is read from a flash drive to read via memory mapping file, it usually gives the increase in IO and no need to allocate a temporary buffer, only the texture on the flash drive should be in RAW format. The more I painted on another online.
The logic (if not to take into account a possible caching within the GPU if it is there) that as the field of reading and writing do not overlap, no problems should arise. And what kind of map\unmap textures in gles 2.0? There's no PBO - toney_OHara commented on October 3rd 19 at 02:32
How would OpenGL API not only can be played with GPU in iOS, there is a texture cache in CoreVideo, it looks like Carmack and was streaming your iOS textures in Rage. Under the Tegra is the PBO extension. And sobsno very PBO added in OpenGL ES 3.0. But you can certainly give the data glTexSubImage2D and let it correct itself there. - ewald_Macejkovic commented on October 3rd 19 at 02:35

Find more questions by tags 3DOpenGL