[英]Does the Android emulator support OpenGL ES 3.0?
我知道模拟器在SDK工具17和Android 4.0.3中支持OpenGL ES 2.0 ,但是在2012年4月推出。
Android模拟器是否支持OpenGL ES 3.0,还是我们还在等待?
如果没有,是否有任何其他第三方仿真器/模拟器(例如Genymotion)支持OpenGL ES 3.0?
最新的Android Emulator现在支持OpenGL ES 3.0。 要使用OpenGL ES 3.0,您的开发机器需要一个主机GPU图形卡,在Microsoft®Windows®或Linux上支持OpenGL 3.2或更高版本。
请参阅: https : //android-developers.googleblog.com/2017/05/android-studio-3-0-canary1.html
来自NDK的gles3jni
示例应用程序是一个很好的选择来尝试它。
如果它失败了:
java.lang.RuntimeException: createContext failed: EGL_BAD_CONFIG
也尝试先在主机上运行:
echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini
由于开发人员目前将支持的主机GPU列入白名单,并且覆盖它,请参阅: https : //issuetracker.google.com/issues/68496715
Android Emulator和系统映像以及Genymotion目前都不支持OpenGL ES 3.0版。
在我写这篇文章时,Android 5.1.1(API 22)的最新(Rev。1)ARM和x86系统映像报告它们支持OpenGL ES 2.0版而不是3.0版。
同样,Genymotion的Nexus 5 Android 5.1.0 API 22虚拟设备仅报告OpenGL ES 2.0版支持。
您可以使用以下代码检查未来系统映像和模拟器下的支持:
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);
}
}
我通过运行glGetString(GLES20.GL_VERSION)
找到了模拟器支持的版本。 我测试的模拟器似乎不支持OpenGL ES 3.0或更高版本,但我不想假设他们报告的是他们实际支持的内容,所以我不承诺这个词是最终的。
在我的Nexus 5上
OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)
使用HAXM的Android模拟器
OpenGL ES 2.0 (2.1 NVIDIA-10.2.7 310.41.25f01)
Genymotion模拟器
OpenGL ES 2.0 (2.1 NVIDIA-10.2.7 310.41.25f01)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.