多个 GLES 上下文,一个帧缓冲区 (iOS)
我正在做一个 iOS 应用程序,其中有一个黑盒渲染库,它有自己的 EAGLContext 和帧缓冲区,并进行自己的渲染。我还需要在黑盒库之外进行额外的渲染。
到目前为止,我一直通过仔细阅读、设置和恢复每帧的所有相关状态来做到这一点。这可行,但非常繁琐且难以维护。然后我想到,“为什么不使用单独的 EAGLContext 呢?”
我已经实现了第二个上下文,所以现在我正在切换上下文,而不是设置/恢复每帧的所有状态。唯一的问题是我得到了很多视觉伪影,并且性能从坚如磐石的 30 FPS 变为大约 5 FPS...
所以显然我不打算从多个上下文渲染到相同的帧缓冲区。谁能证实这一点吗?
I'm doing an iOS app where I have a black box rendering library that has its own EAGLContext and framebuffer and does it's own rendering. I also need to do additional rendering outside the black box lib.
Up until now I've been doing that by carefully reading, setting and restoring all the pertinent states each frame. This works, but is fiddly and hard to maintain. Then it occurred to me, "Why not have a separate EAGLContext instead?"
I've implemented a second context, so now I'm switching contexts instead of setting/restoring all the states each frame. Only problem is I'm getting lots of visual artifacts and the performance went from a rock solid 30 FPS to about 5 FPS...
So apparently I'm not meant to render to the same framebuffer from several contexts. Can anyone confirm this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论