创建一个 eglContext 有:
EGLContext eglCreateContext( EGLDisplay display,
EGLConfig config,
EGLContext share_context,
EGLint const * attrib_list);
规范允许指定一个 share_context,它允许在两个上下文之间共享对象。
如果确实指定了 share_context 究竟共享什么(程序、纹理、帧缓冲区对象)?究竟什么仍然在沙盒中?
此外,这种共享是双向的还是只有一种方式?
最佳答案
OGL ES 2.0.25 规范的摘录(附录 C: 共享对象和多个上下文):
The share list of a context is the group of all contexts which share objects with that context. Objects that can be shared between contexts on the share list include vertex buffer objects, program and shader objects, renderbuffer objects, and texture objects (except for the texture objects named zero). It is undefined whether framebuffer objects are shared by contexts on the share list. The framebuffer object namespace may or may not be shared. This means that using the same name for a framebuffer object in multiple contexts on the share list could either result in multiple distinct framebuffer objects, or in a single framebuffer object which is shared. Therefore applications using OpenGL ES should avoid using the same framebuffer object name in multiple contexts on the same share list.
关于c++ - 与 OpenGL ES 共享 egl 上下文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29278507/