0

I'm trying to compile a simple geometry shader in Android. I'm using GLES32.GL_GEOMETRY_SHADER as the shader type so that shader creation uses GLES32.glCreateShader(GLES32.GL_GEOMETRY_SHADER);. Context has been set in the GLSurfaceView as setEGLContextClientVersion(3);.

When it creates the shader, the following error is shown:

2021-04-01 18:00:16.120 7289-7332/com.alura.dyno E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glCreateShader:1871 GL error 0x500

Vertex and Fragment shaders are generated without any problem.

  1. Can I use geometry shaders in AVDs? There seems to be some restriction in regard to newer versions of OpenGL ES in AVD;
  2. If so, is there any other reason that might be causing this problem?
genpfault
  • 51,148
  • 11
  • 85
  • 139
  • Is it definitely a GLES 3.2 context? [This](https://stackoverflow.com/questions/32765757/glsurfaceview-with-opengl-es-3-1-context) post contains some code showing how to check. – Columbo Apr 01 '21 at 22:36
  • It is currently returning 3.0. Is there any way to specify 3.2? According to this post, it seems to be fine to create a 3 context: https://stackoverflow.com/questions/32765757/glsurfaceview-with-opengl-es-3-1-context – Luís Filipe Longo Apr 01 '21 at 22:40
  • Sorry, not sure. I know you can specify a required GLES version in your manifest (https://developer.android.com/guide/topics/manifest/uses-feature-element) but that perhaps doesn't help you with AVD. – Columbo Apr 02 '21 at 10:19
  • When you create a AVD in Android Studio, under 'Emulated Performance - Graphics', I only see 'Automated','Hardware - GLES 2.0', and 'Software - GLES 2.0' [at least on a Mac]. What PC/OS are you using and do you see other options? – Morrison Chang Apr 06 '21 at 04:07
  • I get the 3.0 context right, but 3.2 doesn't seem to workshop properly. It compiles just fine in a physical device. I guess that'll be the easiest alternative – Luís Filipe Longo Apr 09 '21 at 04:06

0 Answers0