Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ICS: What does the system "Force GPU Rendering" option actually do?

I find that when I enable this developer option, my OpenGL project stops working. A bit alarming to say the least.

Logcat shows a zillion of these:

 E/libEGL  ( 1022): called unimplemented OpenGL ES API
 E/libEGL  ( 1022): called unimplemented OpenGL ES API
 E/libEGL  ( 1022): called unimplemented OpenGL ES API
 ...

The first scene renders perfectly well, but after that first swapbuffers(), all susbequent GL ES APIs (even glSetMatrixMode()) do nothing but log "unimplemented API".

This all works perfectly well (i.e. is implemented) if I have the "Force GPU rendering" option turned off.

So, what does this option actually do?

like image 632
Reuben Scratton Avatar asked Dec 20 '11 21:12

Reuben Scratton


2 Answers

That option is intended for developers, so that they could easily test their apps with H/W Acceleration turned on. As I understand it, a 2D app that uses Canvas Apis can benefit from this option since turning this on will indeed force the system to create a native GLES2.0 Context on a different thread and have the Canvas Class use the GLES h/w accelerated backend instead of the Skia one. This native GLES2.0 context creation happens in C Native code and the app developer has no control over this.

Going back to your issue, the "called unimplemented error message" is basically saying that either (1) you're indeed using the wrong GL Context (for example, making GLES1.1 calls with a GLES2.0 context or viceversa) or (2) your device wasn't able to load the GLES drivers and thus the system failing to find the actual GL function pointer. The system knows what to load by reading the egl.cfg file found under /system/lib/egl/ and the GL driver itself is found under /system/vendor/lib/.

I would follow up with Google as this may just be a bug.

like image 119
csanta Avatar answered Oct 05 '22 23:10

csanta


It forces hardware acceleration in all applications. You can read more about it here: http://developer.android.com/guide/topics/graphics/hardware-accel.html

Make sure to check out the Unsupported operations, which is likely where you are running into issues.

like image 38
smith324 Avatar answered Oct 05 '22 22:10

smith324