Hi, I'm trying to run a benchmarking tool on the Samsung Galaxy S5 to test some optimizations and perhaps start experimenting with the use of ASTC. It seems like the GL driver is failing to create a context without an associated window to render into. As you may know, opening a window on Android is a fairly involved process, so ideally I'd like to avoid it. I've attached the code that should be initializing the context and the results below:
EGLint error = EGL_SUCCESS; if (EGL_SUCCESS != (error = eglGetError())) { Debugf("Prior EGL error: %s\n", getEGLErrorStr(error)); return NULL; } fDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (fDisplay == EGL_NO_DISPLAY || EGL_SUCCESS != (error = eglGetError())) { Debugf("eglGetDisplay failed -- error: %s\n", getEGLErrorStr(error)); return NULL; } EGLint majorVersion; EGLint minorVersion; if (EGL_TRUE != eglInitialize(fDisplay, &majorVersion, &minorVersion)) { if (EGL_SUCCESS != (error = eglGetError())) { Debugf("eglInitialize failed -- error: %s\n", getEGLErrorStr(error)); return NULL; } } Debugf("Major: %d, minor: %d\n", majorVersion, minorVersion); Debugf("VENDOR: %s\n", eglQueryString(fDisplay, EGL_VENDOR)); Debugf("APIS: %s\n", eglQueryString(fDisplay, EGL_CLIENT_APIS)); Debugf("VERSION: %s\n", eglQueryString(fDisplay, EGL_VERSION)); Debugf("EXTENSIONS %s\n", eglQueryString(fDisplay, EGL_EXTENSIONS)); if (!eglBindAPI(EGL_OPENGL_ES_API)) { return NULL; } if (EGL_SUCCESS != (error = eglGetError())) { Debugf("eglBindAPI failed -- error: %s\n", getEGLErrorStr(error)); return NULL; } EGLint numConfigs; const EGLint configAttribs[] = { EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_ALPHA_SIZE, EGL_DONT_CARE, EGL_DEPTH_SIZE, EGL_DONT_CARE, EGL_STENCIL_SIZE, EGL_DONT_CARE, EGL_NONE }; EGLConfig surfaceConfig; if (!eglChooseConfig(fDisplay, configAttribs, &surfaceConfig, 1, &numConfigs)) { Debugf("eglChooseConfig failed. EGL Error: 0x%08x\n", eglGetError()); return NULL; }
The output:
Major: 1, minor: 4
VENDOR: Android
APIS: OpenGL_ES
VERSION: 1.4 Android META-EGL
EXTENSIONS EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time
eglChooseConfig failed. EGL Error: 0x00003001
I'm hesitant to say that this is a bug in the driver, but I'm not totally sure what I'm doing wrong in my initialization code. Any help would be appreciated . Also, if this isn't an appropriate forum for a question like this, I'd be glad to direct it to the right place.
I'm hesitant to say that this is a bug in the driver, but I'm not totally sure what I'm doing wrong in my initialization code.
Do you know if the same code happens to work on other Android devices?
As the info strings you captured indicate, on Android you don't talk to our EGL implementation directly - Android itself provides a "meta EGL" layer which performs some processing before handing off to the underlying graphics hardware drivers - and in many cases that Android EGL layer is closely tied to the window system integration so there is some possibility that the call isn't even making it as far as the Mali drivers.
Cheers, A different Pete ;P
Hi different Pete,
Thanks for pointing out the bit about META-EGL. I hadn't noticed that. This code works on many many other android devices, so it came as a surprise to me that it didn't work on the S5. I will do a bit of digging to see if the interface between META-EGL and the driver code is causing any problems.
Thanks!
Thanks for confirming - we'll take a look our side too - if it works on other devices it's unlikely to be the fault of the meta layer, as that is common on all platforms.
Cheers, Pete