I encountered a bug on my opengl app, sometimes during the app is running a EGL error occurred:
E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
its very frustrating because most of the EGL_BAD_DISPLAY kinds of errors as my experience is happening at the EGLContext creation time.
but in my case it seems like the EGL suddenly lost its display, how can this possible? unfortunately I can't upgrade my device's operating system(its a custom version of android 7.1 shipping with device vendor)
the only reason I can think of is the libEGL shipped along with the OS is buggy, therefore if I can build my own libEGL from source to replace the old one then maybe I can fix this problem. so my question is Is it possible to build my own EGL library to replace the Android one? if it is how can I do it?
It depends which part of EGL has an error; Android has two layers.
The underlying "real" EGL implementation is unlikely to be replaceable - it is normally part of the graphics stack and the same library as OpenGL ES from the GPU vendor and therefore closed source.
Android itself implements a thin shim EGL which handles buffer management, so if the error is in this part then you might have some luck with the version in AOSP.