Failed to create OpenGL ES 3.0 Context - opengl-es

I'm trying to to use GLSL for OpenGL ES 3.0 with OpenGL ES Context 2.0 on Android Emulator Nexus 6 API 24. I declare in my vertex shader and fragment shader with
"#version 300 es"
But I got error: "unsupported shader version". After searching around, I think that maybe changing to OpenGL ES Context 3.0 would solve my problem. Therefore, I edit my GLES3JNIView.java (from this sample: https://github.com/googlesamples/android-ndk/tree/master/gles3jni/app/src/main/java/com/android/gles3jni).
Change the context from 2 to 3 with
setEGLContextClientVersion(3);
and edit the manifest:
< uses-feature android:glEsVersion="0x00030000" android:required="true" />
But I ran into another problem, when I run the app, it crashes on launching.
I found these in the logcat:
02-14 17:29:04.879 5546-5546/? I/art: Not late-enabling -Xcheck:jni (already on)
02-14 17:29:04.879 5546-5546/? W/art: Unexpected CPU variant for X86 using defaults: x86
02-14 17:29:05.215 5546-5568/com.android.gl2jni I/OpenGLRenderer: Initialized EGL, version 1.4
02-14 17:29:05.215 5546-5568/com.android.gl2jni D/OpenGLRenderer: Swap behavior 1
02-14 17:29:05.313 5546-5568/com.android.gl2jni E/EGL_emulation: tid 5568: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
02-14 17:29:05.313 5546-5568/com.android.gl2jni W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa917dca0, error=EGL_BAD_MATCH
[ 02-14 17:29:05.430 5546: 5565 D/ ]
HostConnection::get() New Host Connection established 0xacd1d780, tid 5565
02-14 17:29:05.435 5546-5565/com.android.gl2jni E/AndroidRuntime: FATAL EXCEPTION: GLThread 157
Process: com.android.gl2jni, PID: 5546
java.lang.IllegalArgumentException: eglChooseConfig failed
at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:865)
at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1036)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1416)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1253)
What am I doing wrong?

OpenGL ES 3.0 isn't supported on the Android emulator.
See:
https://developer.android.com/ndk/guides/stable_apis.html
Specifically:
Note: The Android emulator does not support OpenGL ES 3.0 hardware
emulation. Running and testing code that uses this API requires a real
device with hardware that can support OpenGL ES 3.0

Related

Incorrect GL_VENDOR and GL_RENDERER in Chromium build

I'm building a Chromium project under macOS Catalina (10.15.7) following the instructions https://chromium.googlesource.com/chromium/src/+/master/docs/mac_build_instructions.md.
The compilation is successful, but the resulting binary has problems with hardware acceleration. Some pages are rendered by the browser with strange artifacts (black rectangles in different places of the web pages).
Output chrome://gpu
Driver vendor ANGLE
Driver version 2.1.14218
Pixel shader version 1.00
Vertex shader version 1.00
Max. MSAA samples 4
GL_VENDOR Google Inc.
GL_RENDER ANGLE (ATI Technologies Inc., AMD Radeon Pro 570 OpenGL Engine, OpenGL 4.1 core)
GL_VERSION OpenGL ES 2.0.0 (ANGLE 2.1.14218 git hash: f9e59ad07855)
But the Chromium binary downloaded from here https://chromium.woolyss.com/ doesn't have these problems with page rendering and hardware acceleration.
Downloaded Chromium output chrome://gpu
Driver vendor ATI
Driver version 3.10.19
Pixel shader version 4.10
Vertex shader version 4.10
Max. MSAA samples 8
GL_VENDOR ATI Technologies Inc.
GL_RENDERER AMD Radeon Pro 570 OpenGL Engine
GL_VERSION 4.1 ATI-3.10.19
The versions of Chromium are absolutely identical. For some reason my build chooses ANGLE as GL_RENDERER instead of native ATI driver.
I use the following args.gn to build:
ffmpeg_branding="Chrome"
is_official_build=true
proprietary_codecs=true
is_component_build=false
enable_stripping=true
is_debug=false
enable_nacl=false
blink_symbol_level=0
strip_absolute_paths_from_debug_symbols=true
symbol_level=0
dcheck_always_on=false
enable_plugins=true
enable_pdf=true
If anyone has encountered a similar problem, which way to look to fix this?

AVD not launching

The system configuration I am using is as following:
OS - Windows 7 (64 bit)
RAM - 8GB
Eclipse - Kepler release
Java - 1.6.0_45 (64 bit)
Android SDK - 22.2.1
ADT - 22.2.1.v201309180102-833290
Graphics Card - Intel(R) HD Graphics 400, version - 8.15.10.2696
When I create a new AVD and launch it an error always comes up - 'emulator-arm.exe has stopped working' - with the following details:
Problem signature:
Problem Event Name: APPCRASH
Application Name: emulator-arm.exe
Application Version: 0.0.0.0
Application Timestamp: 5238f89b
Fault Module Name: ig7icd32.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 4f67b1c8
Exception Code: c0000005
Exception Offset: 000256e6
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 16393
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
I have gone through various other questions addressing this issue as following:
emulator.exe has stop working?
Error Message: emulator-arm.exe has stopped working
emulator-arm.exe has stopped working
I have tried all the following options suggested by them:
Change the RAM value - I have tried with all values ranging from 256 to 1907
Change the target - Have tried the versions from 4.1.2, 4.2.2, 4.2 along with their Google APIs
Change the device - Have tried with various versions of Nexus along with WSVGA
Change the Heap - Have tried with different values of Heap size
Change the resolution - Have tried with various resolutions as per the device
But every time, for every new AVD, as soon as I launch it, I am getting the same error - 'emulator-arm.exe has stopped working' - with exactly the same Problem Signature as shared above.
Could someone point me in the right direction that how can this be resolved?
UPDATE: I invoked Android Debug Monitor to view the LogCat when the device is being launched but there are no log messages getting displayed there.
Any suggestions anyone on how to resolve this?
Try turning off the "Use host GPU" option. Perhaps your computer's GPU is not compatible with the emulator.
This may be due to a compatibility problem with the Intel HD Graphics driver. I would suggest you to update the driver to the latest available version and check.

3D application fails to run on Intel i3-2120

I have a Virtual machine running Ubuntu on my windows7 PC. The machine has Intel i3-2120 processor. So I suppose it has support for OpenGL APIs as the processor has in-built Intel HD Graphics 2000 GPU.
I am using OpenGL ES 2.0 Emulator from ARM to build and run 3D application. I am new to OpenGL ES. I had built a cube application which comes with the example in Emulator itself just to test whether if the setup is ready to run 3D application.
The application does not run and it fails in compiling the shader in the below steps:
GL_CHECK(glCompileShader(*pShader));
GL_CHECK(glGetShaderiv(*pShader, GL_COMPILE_STATUS, &iStatus));
Is this issue somewhere related to hardware? Could someone please help in figuring out what is wrong here with the setup?
Thanks!!
If you don't have any errors in shader code, it should be due to virtualisation. Check if you have 3D acceleration support on you ubuntu.
Execute this in terminal: glxinfo | grep rendering
If you get "direct rendering: No", there is your problem. Check if your virtualisation application supports 3D acceleration and how to enable it.

Nvidia Nsight 2.2 OpenGL shader debugger - not working?

I've got NVidia's Parallel Nsight 2.2 system configured on my two computers. The target has a Geforce 450 gts with driver ver 301.42 and the host a Quadro 1000M with the same driver version. Loading the simplest OpenGL 3.0 program (display a colored triangle using shaders) runs fine but I can't seem to get the Nsight shader debugger to work.
Everything seems to work, I can open the NSight->Windows->Shaders List window, double click a shader, have the source code open and select a line and set a breakpoint. A big fat red dot shows up to indicate the break point is set, but the breakpoint is NEVER hit, so I'm stuck.
Has anyone ever got the OpenGL shader debugger working with Parallel Nsight 2.2?
B.t.w. the NSight->New Analysis Activity works great. I can create a trace of all the openGL calls and view it with no problems.
The OpenGL shader debugger requires a driver that is not released yet. You will need a driver more recent than 306.37 to get a good debugging experience.
-s

If I have OpenGL ES 2.0, do I also have 1.0?

I have Win 7 64. Open GL 2.0. In working with the Android download, Dalvik, etc., I apparently also have OpenGL ES 2.0.
An Imagine Technology emulator also has this to say about what it sees on my system:
PVRVFrameSetGlesLibraryPath: C:\my_dir\Bin\libGLES_CM.dll
PVRVFrameSetGlesv2LibraryPath: C:\my_dir\Bin\libGLESv2.dll
vendor/shl: Imagination Technologies (Host GL: `ATI Technologies Inc.`)
vendor/shl: OpenGL ES 1.1 ( SDK build: 2.06.26.0641)2.1.8304 Release`)
bufek withs es1 exts: OGLES1 EXTENSIONS: GL_OES_byte_coordinates GL_OES_fixed_po
int GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compress
ed_paletted_texture GL_OES_point_sprite GL_OES_point_size_array GL_OES_matrix_pa
lette GL_OES_draw_texture GL_OES_query_matrix GL_IMG_read_format GL_IMG_texture_
compression_pvrtc GL_IMG_texture_format_BGRA8888 GL_OES_texture_env_crossbar GL_
OES_texture_mirrored_repeat GL_OES_blend_subtract GL_OES_blend_func_separate GL_
OES_blend_equation_separate GL_OES_stencil_wrap GL_OES_extended_matrix_palette G
L_OES_stencil8 GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_texture_cube_map GL_OES_c
ompressed_ETC1_RGB8_texture GL_OES_mapbuffer GL_EXT_multi_draw_arrays GL_OES_fra
mebuffer_object
vendor/shl: Imagination Technologies (Host GL: `ATI Technologies Inc.`)
vendor/shl: OpenGL ES 2.0 ( SDK build: 2.06.26.0641) 2.1.8304 Release`)
vendor/shl: OpenGL ES GLSL ES 1.00 ( Host GL: `1.20`)
Success.
Success.
My question is, do I have OpenGL ES 1.0 and 1.1 and 2.0 available to me? All three?
Well, yes and no, the emulator is providing GL ES emulation, it's not available directly in your system. But inside the emulator you have GL ES 1.0/1.1 and GL ES 2.0.

Resources