Does the Android emulator support OpenGL ES 3.0?

只愿长相守 提交于 2019-12-17 07:47:32

问题


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?


回答1:


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




回答2:


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);
    }

}



回答3:


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)



来源:https://stackoverflow.com/questions/24874066/does-the-android-emulator-support-opengl-es-3-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!