是否可以在嵌入式平台上直接访问 OpenGL ES 2.0 纹理内存?
我正在基于 OMAP 3530 的平台上编写一些 GP-GPU 代码,并且由于 openGL ES 2.0 中缺少 glGetTexImage 函数而受到阻碍。由于该平台使用 GPU 的集成内存,我想知道是否可以采取任何方式来获取直接指向内存中已分配纹理的指针。这样我就可以读回数据,而不必将其推送到帧缓冲区,这会丢弃大量数据。
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 uses 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,没有办法做到你所描述的。最接近且最有效的方法是渲染到 FBO,这样可以将纹理绑定为颜色缓冲区并使用 glReadPixels 来获取像素。由于 glReadPixels api,这仍然需要读取帧缓冲区。不过,与其他方法相比,使用 FBO 有一些优点:
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: