I'm working on some GP-GPU code on an OMAP 3530-based platform and I'm being stymied by the lack of a glGetTexImage function in openGL ES 2.0. Since the platform u开发者_Python百科ses integrated memory for the GPU, I was wondering if there's any kind of hack I can do to get a pointer directly to an allocated texture in memory. This way I could read my data back without having to push it through the framebuffer, which throws away a lot of data.
As far as I know there is no way to do what you describe. The closest and most efficient way to do that would be rendering to an FBO, this way one could bind the texture as the color buffer and use glReadPixels to get the pixels back. This still requires reading the Framebuffers due to glReadPixels api. There are a few advantages of using FBOs over other methods though:
- you can create and use multiple FBOs within the same EGLContext (no need for a context switch, if you were to use a PBuffer for instance)
- you can share color (and depth/stencil) buffers across FBOs
- you can attach textures directly to the FBO without the need to do a copy operation
精彩评论