-->

Detecting good GPU on Android

2019-08-15 06:01发布

问题:

I am looking for a safe way to detect whether the current GPU belongs to the current high end profile (such as Motorola's Atrix or Galaxy s2) so I can, in run-time, enable some more sophisticated visual effects in my game.

Has anyone successfully done anything similar? I though about detecting dual-core CPU, which would usually come with a good GPU, but I don't have enough devices to test if it is going to work OK on most situations.

回答1:

If those "more sophisticated visual effects" require OpenGL ES extensions, you can simply test for the presence of those extensions.

If they do not, it would probably be better in the long run to simply allow the user to configure their graphics setup. Otherwise, if a new GPU comes out, it won't be on your hard-coded list of GPUs and thus they'll get low-quality graphics.



回答2:

Get available processors: http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Runtime.html#availableProcessors()



回答3:

Android being above a Linux kernel, did you consider reading sequentially and parsing the /proc/cpuinfo file ?



回答4:

Since I'm making an application not a game, I need to auto configure what is best. For the size of the textures I test for heap size and used heap. Also small textures if running in software mode (PixelFlinger).

If it has good amount of heap free and 2 cpus then I run the 3d engine in OpenGL 2.0 with AA. So far this works great with the amount of devices we have.

Note: I have noticed that some phone roms report 1 cpu free when there is 2.