sydd sydd - 2 months ago 6x
Android Question

Get maximum workgroup size for compute shaders?

I am writing an OpenGL ES 3.1 program and want to know the maximum workgroup size for the device I'm running on (its running on Android 6).

For PC querying

works fine, but I cant seem to do the equivalent for on Android, I get
OpenGL error: InvalidEnum
when I try something like

OpenTK code:

int[] work_grp_cnt = new int[3];
GL.GetInteger(All.MaxComputeWorkGroupCount, work_grp_cnt);

Same with native Android APIs:

int[] work_grp_cnt = new int[3];
IntBuffer maxCount = IntBuffer.Allocate(3);
GLES20.GlGetIntegerv(GLES31.GlMaxComputeWorkGroupCount, maxCount);

(in both cases the GLGetInteger raises the same InvalidEnum error)
Is this possible with OpenGL ES 3.1?

I am using a Sony Xperia Z5


In C, you must call glGetIntegeri_v, which takes an index. For GL_MAX_COMPUTE_WORK_GROUP_COUNT, the index is the dimension you want to query. It only returns one value at a time.

You will need to find and use the Java-equivalent of this function.