共享上下文和纹理 GLES20 之间的不同 GLSurfaceViews?

是否可以划分上下文 GLES20 之间的不同 GLSurfaceViews /在一种活动中/? 或者,因为可以将一组纹理划分在不同之间 GLSurfaceViews?

在 iOS, 如果您想保存内存并重用 /大/ 不同的纹理 CAEAGLLayer-backed UIViews, 你可以通过对象 EAGLContext 它们之间或使用不同 EAGLContexts, 它共享一个共同对象 EAGLSharegroup.

我想知道如何做到这一点 Android. 有等同的技术吗?

Edit1

实现自己的初步提案 EGLContextFactory, 谁会回来相同 EGLContext, 不起作用,因为每个人 GLSurfaceViews 发送渲染到您自己的私人渲染流 gl, 并分享相同 EGLContext 在不同的流之间是不可能的。

praphrase我的初步问题:
你有几个 GLSurfaceViews 在一个屏幕上 /一个动作/, 并且您需要访问一组常见,但在单独的情况下进行大纹理 EGLContext 每个表面,但加载纹理比设备的内存高几倍。 然后你会如何分享他们的纹理 GLSurfaceViews?
已邀请:

君笑尘

赞同来自:

以下代码适用于某些设备,但根本并非:


public EGLContext createContext/EGL10 egl, EGLDisplay display, EGLConfig eglConfig/ {
EGLContext shared = .....;

int[] attrib_list = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
EGLContext context = egl.eglCreateContext/display, eglConfig, shared == null ? EGL10.EGL_NO_CONTEXT : shared,
attrib_list/;

return context;
}
}

龙天

赞同来自:

http://developer.android.com/r ... %2529
http://android.git.kernel.org/ ... DHEAD
看起来 setEGLContextFactory 允许您使用相同的上下文 GLES20 之间的不同 GLSurfaceViews.

伪码:


private class MyEGLContextFactory implements EGLContextFactory {
private static EGLContext mEGLContext;

public EGLContext createContext/EGL10 egl, EGLDisplay display, EGLConfig config/ {
/* create EGLContext for GLES20 in first time */
return mEGLContext;
}

public void destroyContext/EGL10 egl, EGLDisplay display,
EGLContext context/ {
}
}

要回复问题请先登录注册