16

I know that the emulator has supported OpenGL ES 2.0 as of SDK tools 17 and Android 4.0.3, but that was introduced back in April 2012.

Does the Android emulator support OpenGL ES 3.0, or are we still waiting on that?
If not, does any other third-party emulator/simulator (e.g. Genymotion) support OpenGL ES 3.0?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Cypress Frankenfeld
  • 2,317
  • 2
  • 28
  • 40

3 Answers3

13

The latest Android Emulator now supports OpenGL ES 3.0. To use OpenGL ES 3.0, your development machine needs a host GPU graphics card that supports OpenGL 3.2 or higher on Microsoft® Windows® or Linux.

See: https://android-developers.googleblog.com/2017/05/android-studio-3-0-canary1.html

OpenGL ES 3.0 in Android Emulator

The gles3jni sample app from the NDK is a good option to try it out.

If it fails with:

java.lang.RuntimeException: createContext failed: EGL_BAD_CONFIG

also try to run first on host:

echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini

as the devs are currently whitelisting supported host GPUs, and that overrides it, see also: https://issuetracker.google.com/issues/68496715

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Jamal Eason
  • 6,260
  • 2
  • 19
  • 15
  • Hi Jamal, have you actually seen this working on your own machine? – aaaidan Sep 15 '17 at 05:57
  • Yes. If there is any issue let me know. You can also file a bug here: https://issuetracker.google.com/issues/new?component=192727 and we can take a deeper look. – Jamal Eason Oct 25 '17 at 12:03
  • Awesome! Now only Vulkan is missing :-) https://stackoverflow.com/questions/42581120/how-to-create-and-run-an-example-vulkan-app-on-the-android-emulator – Ciro Santilli OurBigBook.com Oct 29 '17 at 03:17
  • I added the ini with the setting and was expecting a drop down option in the AVD to select "GLES 3.0", but I don't see one. I have Android Studio 3.0.1 installed on Windows 10. – Cameron Taggart Mar 05 '18 at 00:22
  • Note that Linux is a registered trademark just as Windows. – jhasse Sep 25 '18 at 14:11
7

Neither the Android Emulator and system images nor Genymotion currently support OpenGL ES Version 3.0.

As I write this the latest (Rev. 1) ARM and x86 system images for Android 5.1.1 (API 22) report that they support OpenGL ES Version 2.0 and not 3.0.

Similarly, Genymotion's Nexus 5 Android 5.1.0 API 22 virtual device reports only OpenGL ES Version 2.0 support.

You can use the code below to check support under future system images and emulators:

package com.example.opengltest;

import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.ConfigurationInfo;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

public class OpenGLESVersionActivity extends Activity {

    private static final String TAG = "OpenGLESVersionActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        final ActivityManager activityManager =
                (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
        final ConfigurationInfo configurationInfo =
                activityManager.getDeviceConfigurationInfo();
        String versionText = "Device Supported OpenGL ES Version = " + configurationInfo.getGlEsVersion();
        Toast.makeText(this, versionText, Toast.LENGTH_LONG).show();
        Log.d(TAG, versionText);
    }

}
Godfrey Duke
  • 1,505
  • 16
  • 19
  • is this method more reliable than using glGetString(GLES20.GL_VERSION)? I'm curious what the difference between the two are, since running glGetString seems to be easier. – Cypress Frankenfeld May 18 '15 at 18:19
  • glGetString is easier if you already have a valid OpenGL context (e.g. if you're logging from within your Renderer's onSurfaceCreated). The only benefit I see to the approach above is that it doesn't require a GLSurfaceView and Renderer to work. – Godfrey Duke May 19 '15 at 06:24
  • The Android documentation suggests using glGetString: https://developer.android.com/guide/topics/graphics/opengl.html#version-check Note that, in the event setEGLContextClientVersion isn’t invoked upon the GLSurfaceView, e.g.: myGLSurfaceView.setEGLContextClientVersion(2), glGetString may return something like: "OpenGL ES-CM 1.1" which could be a little misleading for our purposes. This post (though it deals with the NDK) describes the same issue: http://stackoverflow.com/questions/25843368/glgetstringgl-version-returns-opengl-es-cm-1-1-but-my-phone-supports-opengl – Godfrey Duke May 19 '15 at 06:53
  • As at 2020, genymotion Google Pixel 9 (API 28) also shows OpenGL 3.0 is not supported with graphic card NVIDIA GeForce GTX 860M (OpengGL 4.6 is supported, verfied via Geeks3D GPU caps viewer) – Gleichmut Jan 31 '20 at 09:26
4

I found the version that the emulator supported by running glGetString(GLES20.GL_VERSION). It appears that the emulators I tested do not support OpenGL ES 3.0 or higher, but I don't want to assume that what they are reporting is what they actually support, so I'm not making any promises that this word is final.

On my Nexus 5

OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)

Android emulator using HAXM

OpenGL ES 2.0 (2.1 NVIDIA-10.2.7 310.41.25f01)

Genymotion emulator

OpenGL ES 2.0 (2.1 NVIDIA-10.2.7 310.41.25f01)

Cypress Frankenfeld
  • 2,317
  • 2
  • 28
  • 40