I have two weird bugs with Unity Android with Adreno GPUs.
Both lead to bad performance in rendering jobs.
First issue:
OpenGL ES 3.0 cannot be initialized properly
Unity Android settings: (see attached image)
ADB Logs:
// Appears 2 times
06-13 11:59:04.893 29180-29199/com.Gaminho.RKWCDev W/Adreno-EGL﹕ <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
// Appears 16 times
06-13 11:59:04.912 29180-29199/com.Gaminho.RKWCDev W/Adreno-EGL﹕ <qeglDrvAPI_eglGetConfigAttrib:606>: EGL_BAD_CONFIG
06-13 11:59:04.913 29180-29199/com.Gaminho.RKWCDev E/Unity﹕ [EGL] eglGetConfigAttrib(): EGL_BAD_CONFIG: An EGLConfig argument does not name a valid EGL frame buffer configuration.
(Filename: ./Runtime/GfxDevice/egl/ConfigEGL.cpp Line: 163)
// Appears 1 time
06-13 11:59:05.202 29180-29199/com.Gaminho.RKWCDev W/libc﹕ pthread_create sched_setscheduler call failed: Operation not permitted
Profile Timeline (see attached image)
When I remove the OpenGLES3 API from the list, the logs and the profile changes:
Log:
// Appears 2 times
06-13 11:59:04.893 29180-29199/com.Gaminho.RKWCDev W/Adreno-EGL﹕ <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
// Appears 1 time
06-13 11:59:05.202 29180-29199/com.Gaminho.RKWCDev W/libc﹕ pthread_create sched_setscheduler call failed: Operation not permitted
Profiler Timeline: (see attached image)
Consequence:
CPU is too busy
Second issue:
OpenGL ES context is invalid in multithreaded rendering
Unity Android settings: Same as before with (multithreaded rendering: true, and without OpenGLES3)
ADB Logs:
// Appears 2 times
06-13 12:23:13.008 29838-29872/com.Gaminho.RKWCDev W/Adreno-EGL﹕ <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
// Appears 1 time
06-13 12:23:13.191 29838-29872/com.Gaminho.RKWCDev W/libc﹕ pthread_create sched_setscheduler call failed: Operation not permitted
// Appears 1 time
06-13 12:23:14.759 29838-29872/com.Gaminho.RKWCDev E/libEGL﹕ call to OpenGL ES API with no current context (logged once per thread)
Yes this may be related, as the GfxWaitForPresent means that the CPU is waiting for the GPU to complete.
So if the GPU takes more time, it will be the case.
@fredpointzero , thanks for the the detailed post.
First regarding performance, the main reason for bad performance in ES 3 is probably caused by Rendering Path “Deferred”. With ES 2 we should fall back to “Forward”, which is much faster.
The “eglGetConfigAttrib” warnings by the Adreno driver are caused Unity’s probing of supported OpenGL ES versions, so some of them are normal.
But the error log by Unity itself could be a real issue.
And “call to OpenGL ES API with no currentcontext (logged once per thread)” is also most likely a bug in Unity.
Not sure if I understand… what kind of fix would you like to see? Better deferred rendering performance on mobile in general? Or did I miss something?
‘call to OpenGL ES API with no currentcontext(logged once per thread)’ will get fixed in a patch release.
I think deferred on mobile is problematic, mostly because of limited bandwidth and high resolutions. GPU features like pixel local storage might solve this but it will take a while until this is available on low- and mid-end devices.
I am looking forward to the patch fixing the ‘call to OpenGL ES API with no currentcontext(logged once per thread)’ issue, so we can use OpenGLES 3 on those devices.
Using deferred on such devices was an experiment and I was pretty sure I would have to use forward rendering for low and mid end devices.
But still, using OpenGLES 3 should have better performance ^^.