Search code examples
androidandroid-emulatorxamarin.androidvisual-studio-emulator

Does the Visual Studio emulator for Android support OpenGL ES 3.0?


I develped an OpenGL ES 3.0 app with Xamarin.Android. It runs well on my phone but crashed on the VS emulator for Android.

It crashes here:

at (wrapper managed-to-native) OpenTK.Graphics.ES30.GL/Core.CreateShader (OpenTK.Graphics.ES30.All) <0x00012>

And an error occurs before:

E/EGL_emulation( 1977): tid 1977: eglGetConfigAttrib(606): error 0x3004 (EGL_BAD_ATTRIBUTE)

I wonder if the simluator doesn't support OpenGL ES 3.0.

In the OpenGL ES Support section of this post,

VS Emulator for Android can now render apps that make use of OpenGL ES up to version 2.0

So, does the Visual Studio emulator for Android support OpenGL ES 3.0?


related logs:

D/Mono    ( 1977): Found as 'java_interop_jnienv_get_object_array_element'.
E/EGL_emulation( 1977): [getAttribValue] Bad attribute idx
E/EGL_emulation( 1977): tid 1977: eglGetConfigAttrib(606): error 0x3004 (EGL_BAD_ATTRIBUTE)
D/Mono    ( 1977): DllImport searching in: '__Internal' ('(null)').
D/Mono    ( 1977): Searching for 'java_interop_jnienv_get_field_id'.
D/Mono    ( 1977): Probing 'java_interop_jnienv_get_field_id'.
D/Mono    ( 1977): Found as 'java_interop_jnienv_get_field_id'.
D/Mono    ( 1977): DllImport searching in: '__Internal' ('(null)').
D/Mono    ( 1977): Searching for 'java_interop_jnienv_get_int_field'.
D/Mono    ( 1977): Probing 'java_interop_jnienv_get_int_field'.
D/Mono    ( 1977): Found as 'java_interop_jnienv_get_int_field'.
D/Mono    ( 1977): Assembly Ref addref Xamarin.OpenGL[0xb42b90a0] -> System[0x9e581dc0]: 4
D/Mono    ( 1977): Assembly Ref addref Xamarin.OpenGL[0xb42b90a0] -> System.Core[0x9d8b71c0]: 4
Resolved pending breakpoint at 'ShaderProgram.cs:27,1' to void CSharpGLES.ShaderProgram.Create (string vertexShaderSource, string fragmentShaderSource, System.Collections.Generic.Dictionary<int,string> attributeLocations) [0x00001].
D/Mono    ( 1977): DllImport attempting to load: 'GLESv2'.
D/Mono    ( 1977): DllImport error loading library './libGLESv2': 'dlopen failed: library "/data/app/Xamarin.OpenGL.Xamarin.OpenGL-1/lib/x86/./libGLESv2" not found'.
D/Mono    ( 1977): DllImport loaded library './libGLESv2.so'.
D/Mono    ( 1977): DllImport searching in: 'GLESv2' ('./libGLESv2.so').
D/Mono    ( 1977): Searching for 'glCreateShader'.
E/mono-rt ( 1977): Stacktrace:
E/mono-rt ( 1977): 
E/mono-rt ( 1977):   at <unknown> <0xffffffff>
E/mono-rt ( 1977):   at (wrapper managed-to-native) OpenTK.Graphics.ES30.GL/Core.CreateShader (OpenTK.Graphics.ES30.All) <0x00012>
E/mono-rt ( 1977):   at OpenTK.Graphics.ES30.GL.CreateShader (OpenTK.Graphics.ES30.All) [0x00002] in /Users/builder/data/lanes/4009/9578cdcd/source/monodroid/src/OpenGLES/OpenTK/Graphics/ES30.Android/GL.cs:1559

Related:


Solution

  • Someone has found the answer for me: OpenGLES 3.0 hasn't been supported.

    from https://blogs.msdn.microsoft.com/visualstudioalm/2015/02/23/the-visual-studio-emulator-for-android-in-vs2015-ctp6/

    ... the VS Emulator for Android can now render apps that make use of OpenGL ES > up to version 2.0. .... (If you’re curious, under the hood we’re forwarding OpenGL ES calls to the host machine’s GPU and using ANGLE to translate the calls to DirectX).

    from ANGLE (https://chromium.googlesource.com/angle/angle/+/master/README.md)

    still not fully support GLES3.0 (in progress).

    so It may cause the error on shader compilation on the emulator.

    Update:

    A staff member of MS told me in another site that the driver of the emulator hasn't supported OpenGLES 3.0. So currently the emulator won't support OpenGL ES 3.0 even if ANGLE does support.