Does the Android emulator support OpenGL ES 3.0?

前端 未结 3 1966
遥遥无期
遥遥无期 2020-11-29 11:22

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 sup

相关标签:
3条回答
  • 2020-11-29 11:39

    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)

    0 讨论(0)
  • 2020-11-29 11:53

    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

    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

    0 讨论(0)
  • 2020-11-29 11:56

    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);
        }
    
    }
    
    0 讨论(0)
提交回复
热议问题