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.
Hi tomhudson, mokosha,
After a bit of further investigation, we think we know the reason why this is happening.
The EGL and GLES driver from ARM Mali does indeed expose both extensions, as I stated before...
However, on Android devices, apps talk to Google's own EGL layer (Seen above as "1.4 Android META-EGL").
This layer is outside of ARM's control and owned by Android (google, or perhaps samsung in this case).
EGL_KHR_surfaceless_context isn't being exposed anywhere in Android 4.4.4 code that I can see, and http://gfxbench.com/ also doesn't report that extension being exposed on other non-Mali based devices.
I hope this helps further, and I apologise for not having a solution for you.
Kind Regards,
Michael McGeagh