OpenGL ES 2.0 Multithreading

Hi,

I have been trying to use OpenGL ES 2.0 to make a photo viewing application. To optimize the code I’m changing the textures loaded with the objects as the user scroll down. But image loading into the texture takes some time and thus the effect is not good. To solve the above problem I tried using multithreading with the following ways:
1.Create a separate context for the new thread and then share the resources(texture object) with the other context
2.Use multiple threads and a single context. Make the context current while executing gl commands in the threads.

But wasn’t successful in either of them. So if anyone has tried similar things with opengl earlier, could you please tell which of the above ones would work and the things I need to pay attention to while doing the same? Also would FBO’s and pbuffers be of any use in this case?

Thanks for any help.

Himanshu

The additional thread would probably just make things slower due to the GLES implementation and driver having to maintain and update states for multiple contexts. The first recommendation that comes to mind, assuming your not doing this already, is buffer images as much as possible. A lot of image viewers, album cover like apps, will often just allow you to flip through images sequentiality, which means you can buffer multiple images on either side of the current position of the user in the list. So more memory expensive, but should help performance.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.