I want to share one context between PbufferSurface(thread #1) and WindowSurface(thread #2).
PbufferSurface is for virtual area to draw image before wayland display attached.
When VALID DISPLAY device attached, I want to draw image to Window Surface.
On thread #1, I created the context for pbuffer, and then on thread #2, I failed to create context with sharing context from context. (error is 0x3006, EGL_BAD_CONTEXT)
Kernel Version: 5.10 (I checked same source code in kernel 4.10 works.)
I have several questions.
-
Should I share Config as well? I searched, and one answer say that config must be same data.
-
If I should share config also, how it works?
Because my configs for pbuffer has “EGL_SURFACE_TYPE, EGL_PBUFFER_BIT”, but other config for window surface has “EGL_SURFACE_TYPE, EGL_WINDOW_BIT”.
So, I couldn’t share the config, when I create window surface, error generated. -
Can I get any example code or sequence about that? Any platform or languages,,,,
Just sharing Context between PBuffer Surface <-> Window Surface.
This is sequence what I did,
Main thread
-
eglInitialize()
-
eglChooseConfig()
-
eglCreatePbufferSurface()
-
eglCreateContext()
thread #1
- eglMakeCurrent()
thread #2
-
eglInitialize()
-
eglChooseConfig()
-
eglCreateWindowSurface()
-
eglCreateContext( get context from (4) ) -> error
Katie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.