1

I try to develop a PPAPI Plugin (in a Chromium application) that Renders 3D Graphics using the OpenGL PPAPI Wrapper. Moreover I'd like to leverage an EGL extension that would allow me to access a shared DirectX Texture that was rendered in another process. I want to use this texture in the PPAPI's Graphics3D OpenGL context (as to display it in the plugin's UI element).

In the PPAPI Plugin I am able to access the shared D3D texture and create an EGL Surface (i.e. a PBuffer actually, using eglCreatePbufferFromClientBuffer). However I assume that when trying to bind this surface to an OpenGL Texture in the Plugin's OpenGL context my EGLSurface is living in a different context than the texture I create in the PPAPI's OpenGL context.

EGLSurface eglSurface = eglCreatePbufferFromClientBuffer(eglDisplay, EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE, m_SharedTextureHandle, eglConfig, pBufferAttributes);
eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext);

glGenTextures(1, &m_glSharedTex);
glBindTexture(GL_TEXTURE_2D, m_glSharedTex);

eglBindTexImage(eglDisplay, eglSurface, EGL_BACK_BUFFER)

This is probably due to me setting up my own EGLDisplay and my own EGLContext

 EGLDisplay eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
 EGLContext eglContext = eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT, pContextAttributes));

However, trying to use an existing context eglGetCurrentContext() returns EGL_NO_CONTEXT, same with the display.

So what I need is access to the Plugin's actual EGLContext. How can I achieve this? Can I somehow share a context in EGL that was created using glSetCurrentContextPPAPI()? Thanks for any hint on this!

cmonsqpr
  • 583
  • 6
  • 13

0 Answers0