14

I've been trying to run code that uses VAOs in C++ using the Android NDK, and running on an emulator. I expect to be able to use glDeleteVertexArraysOES, glGenVertexArraysOES, and glBindVertexArrayOES.

I found that the emulator fails to run the code, even when I use OpenGL ES 2 and dynamically link the extensions using this solution: Are Vertex Array Objects supported in Android OpenGL ES 2.0 using extensions?

I ran glGetString(GL_EXTENSIONS) on a Nexus 4 emulator running API Level 19, and GPU acceleration and got the following:

GL_EXT_debug_marker
GL_OES_EGL_image
GL_OES_depth24
GL_OES_depth32
GL_OES_element_index_uint
GL_OES_texture_float
GL_OES_texture_float_linear
GL_OES_compressed_paletted_texture
GL_OES_compressed_ETC1_RGB8_texture
GL_OES_depth_texture
GL_OES_texture_half_float
GL_OES_texture_half_float_linear
GL_OES_packed_depth_stencil
GL_OES_vertex_half_float

I assume I need to see GL_OES_vertex_array_object in order to use vertex array objects. So it looks like it's a no-go for that particular emulator.

Do you know if it is possible to use vertex array objects in OpenGL ES on any existing Android emulator (third party or otherwise)? If so, how?

Community
  • 1
  • 1
Cypress Frankenfeld
  • 2,317
  • 2
  • 28
  • 40
  • 2
    If the emulator uses hw-accelerated GLES, it depends on the actual implementation _on the host_ if these features are available or not. – derhass May 12 '15 at 18:29
  • 1
    I don't think this is necessarily true. I'm running the emulator on a mid-2014 macbook pro with the NVIDIA GeForce GT 750M 2048 MB, and when I ran glGetString(GL_EXTENSIONS) in the emulator, it reported back that it didn't support vertex array object extensions. When I ran glGetString(GLES20.GL_VERSION) it reported back that it supported only version 2.0. If it were using all the capabilities of the host's GPU, I would expect it to support OpenGL ES 3.0, but I guess I don't really understand this all that well. – Cypress Frankenfeld May 18 '15 at 18:05
  • An application can request a specific version of a GLES context (more or less), and if it does get only 2.0, all of the later features are not necessarily available, even if the GPU would be capable of them. If `glGetString` returned 2.0, you definitively got 2.0. The emulator probably requested it. Maybe you can even change that in some settings dialog. But I've never worked with andorid emulators before, so I have no idea.I also don't know how nvidia handles OES extensions, though. – derhass May 18 '15 at 18:14
  • Officially, it seems this is supposed to be supported by the `` tag in [devices.xml](https://android.googlesource.com/platform/sdk/+/master/files/devices.xml) under the user directory, but from what I can tell from [looking around](http://stackoverflow.com/questions/10641744/samsung-galaxy-s-ii-avd-android-virtual-device-basic-settings), it is currently inoperative. It may have worked at some time in the past, but if it did, it no longer does with latest NDK & Android Studio versions as of this comment's date, AFAICT. – Engineer Jul 27 '15 at 17:29

3 Answers3

1

Officially, this is supposed to be supported by the <d:gl-extensions> tag in devices.xml under the user directory, but from what I can tell from looking around, this functionality is currently inoperative. It may have worked at some time in the past, but if it did, it no longer does with latest NDK & Android Studio versions as of this date. (Hence my bounty, should there be any better answer.)

Community
  • 1
  • 1
Engineer
  • 8,529
  • 7
  • 65
  • 105
0

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

}

its from Does the Android emulator support OpenGL ES 3.0?


Need to change parameters into emulator :

1) You need to edit your emulator image, go down to the hardware section, and add “GPU Emulation” and set it to true.

2) There’s a bug with the emulator such that this line: “final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0×20000;” does not work. It will always return false. You can add “|| Build.FINGERPRINT.startsWith(“generic”)” or simply comment out these checks and assume that OpenGL ES 2 is supported, when running on the emulator.

3) if it crashes with “no config found”, try adding this line before the call to “setRenderer(…)”: “glSurfaceView.setEGLConfigChooser(8 , 8, 8, 8, 16, 0);”

Try this.

Community
  • 1
  • 1
NovusMobile
  • 1,813
  • 2
  • 21
  • 48
  • OpenGL 2.0 can still support vertex array objects if you use extensions. If I only have access to OpenGL 2.0 through the emulator, is there any way to use those extensions? It could still be possible. – Cypress Frankenfeld May 18 '15 at 18:03
  • I updated my answer, changes parameters if it will work for your mark answer, I found lots of people facing this issue.It will help them. – NovusMobile May 20 '15 at 05:07
  • 1
    Your point (1) indicates you do not understand the question. The OP is asking about GL_OES_* extensions support in the emulator. This answer currently does not address that issue. – Engineer Jul 27 '15 at 16:57
0

Not sure how tied is your application with Android platform, but you I guess you can adapt and test your core 3D engine with an emulator from Adreno, PowerVR or Mali SDK. Along side the libEGL and libGLESv2 libs, there are also several companion tools available, including live debug for OpenGL-ES.

Edit: VAO are core features of GLES 3.0. The functions are aliases to glDeleteVertexArrays, glGenVertexArrays, and glBindVertexArray. So, if a SDK offers support to GLES 3.0, it does support OES_VERTEX_ARRAY_OBJECTS.

IMPORTANT : Make sure your PC supports OpenGL 3.x or higher, according SDK requirements.

I'm developing a emulator for Android's OpenGL-ES Java API, using above SDK libs. It is on very early stage and may not help you now, but it runs fine simple examples. One of reasons to develop this java emulator is the limited support to GLES from OS emulators, like Genymotion and others. Now I can rely on native SDK from GPU makers. https://github.com/AlessandroBorges/madri-gles

Alex Byrth
  • 1,328
  • 18
  • 23
  • The issue here is emulator support of OpenGL ES **extensions**, specifically - in this particular case, OES_VERTEX_ARRAY_OBJECTS. If you can supply firm evidence that the Adreno, PowerVR or Mali emulators supply this functionality, I can consider you for the bounty. – Engineer Aug 03 '15 at 17:04
  • Except Google ANGLE, afaik SDK from Adreno, Mali and PowerVR does support OES_VERTEX_ARRAY_OBJECTS extension, including functions void BindVertexArrayOES(uint array); DeleteVertexArraysOES(sizei n, const uint *arrays); void GenVertexArraysOES(sizei n, uint *arrays) and boolean IsVertexArrayOES(uint array); Due limitations of OS emulators, like Genymotion, VMBox and others, they cannot provide all extentions neither full OS HOST OpenGL capability. That is why we need SDKs like Adreno, Mali and PowerVR: in general, OS emulators has limited OpenGL-ES support. – Alex Byrth Aug 03 '15 at 20:17
  • Also check http://community.imgtec.com/files/powervr-supported-extensions/ . It shows that PowerVR SDK does support VAO as Extensions for GLES 2.0 and as Core to 3.0. Must register. – Alex Byrth Aug 03 '15 at 20:27
  • _What a genuine pity_ it is that neither PowerVR, Mali nor Qualcomm support `GL_EXT_draw_instanced`, even though their emulators support ES 3.0 and so should easily support this functionality for ES 2.0. Nonetheless, from the emulator docs, all do support `GL_OES_vertex_array_objects`, so I must award you the bounty. Thanks. – Engineer Aug 03 '15 at 21:32
  • 1
    _GL_EXT_draw_instanced_ **should** be available as an extension for GLES 2.0, when using a emulator with GLES 3.0 capability. BUT, for debugging purposes, you can create a alternate render path and use GLES 3.0, where glDrawArraysInstanced() is available, as it is a core feature of 3.0. – Alex Byrth Aug 04 '15 at 02:29
  • **_P.S.:_** I guess **GL_EXT_draw_instanced** is not a widely supported extension. See http://delphigl.de/glcapsviewer/gles_extensions.php . – Alex Byrth Aug 04 '15 at 02:39