Navigateur
Navigateur

Reputation: 1892

OpenGL ES 2.0 - Is it ok to create & link 100 shader programs at once on a typical Android device?

I'd like to try to create and link up to 100 shader programs (probably 40) at once via glCreateProgram and glLinkProgram (and switch between them in onDrawFrame if I need to).

Each one woud have simple uniforms like one or 2 vec4s, or a single float, etc. Simple question: what is the approximate limit on a typical Android device on the number of such shader programs I can create and link at once? Would 40-100 be ok?

Upvotes: 0

Views: 204

Answers (1)

torbjoernwh
torbjoernwh

Reputation: 445

The GLES2 docs don't mention any specific limit to how many programs you can keep in memory. I guess you could compile and link 10.000's of programs. The only limit should be the amount of memory available. It all depends on the program, both the ascii-source and the compiled binary will be stored by the GLES context.

For other limits, look what the glGet* functions can return.

glGet[Booleanv|Floatv|Integerv], gles2 docs

Upvotes: 1

Related Questions