简体   繁体   English

Android模拟器是否支持OpenGL ES 3.0?

[英]Does the Android emulator support OpenGL ES 3.0?

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. 我知道模拟器在SDK工具17和Android 4.0.3中支持OpenGL ES 2.0 ,但是在2012年4月推出。

Does the Android emulator support OpenGL ES 3.0, or are we still waiting on that? Android模拟器是否支持OpenGL ES 3.0,还是我们还在等待?
If not, does any other third-party emulator/simulator (eg Genymotion) support OpenGL ES 3.0? 如果没有,是否有任何其他第三方仿真器/模拟器(例如Genymotion)支持OpenGL ES 3.0?

The latest Android Emulator now supports OpenGL ES 3.0. 最新的Android Emulator现在支持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. 要使用OpenGL ES 3.0,您的开发机器需要一个主机GPU图形卡,在Microsoft®Windows®或Linux上支持OpenGL 3.2或更高版本。

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

Android模拟器中的OpenGL ES 3.0

The gles3jni sample app from the NDK is a good option to try it out. 来自NDK的gles3jni示例应用程序是一个很好的选择来尝试它。

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 由于开发人员目前将支持的主机GPU列入白名单,并且覆盖它,请参阅: https//issuetracker.google.com/issues/68496715

Neither the Android Emulator and system images nor Genymotion currently support OpenGL ES Version 3.0. Android Emulator和系统映像以及Genymotion目前都不支持OpenGL ES 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. 在我写这篇文章时,Android 5.1.1(API 22)的最新(Rev。1)ARM和x86系统映像报告它们支持OpenGL ES 2.0版而不是3.0版。

Similarly, Genymotion's Nexus 5 Android 5.1.0 API 22 virtual device reports only OpenGL ES Version 2.0 support. 同样,Genymotion的Nexus 5 Android 5.1.0 API 22虚拟设备仅报告OpenGL ES 2.0版支持。

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

}

I found the version that the emulator supported by running glGetString(GLES20.GL_VERSION) . 我通过运行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. 我测试的模拟器似乎不支持OpenGL ES 3.0或更高版本,但我不想假设他们报告的是他们实际支持的内容,所以我不承诺这个词是最终的。

On my Nexus 5 在我的Nexus 5上

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

Android emulator using HAXM 使用HAXM的Android模拟器

OpenGL ES 2.0 (2.1 NVIDIA-10.2.7 310.41.25f01)

Genymotion emulator Genymotion模拟器

OpenGL ES 2.0 (2.1 NVIDIA-10.2.7 310.41.25f01)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM