Or Arbel
Or Arbel

Reputation: 2975

OpenGL ES 2.0 on iPhone - How many texture units can i use?

In apple's docs:(http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/OpenGLESPlatforms/OpenGLESPlatforms.html)

it says that for "OpenGL ES 1.1 on the PowerVR SGX" "There are 8 texture units available."

it doesn't say how many units are available on OpenGL ES 2.0, does that mean there is no limit?

Upvotes: 6

Views: 9186

Answers (3)

user1118321
user1118321

Reputation: 26345

Rather than asking and getting an answer that may or may not be correct in the future, your app should be checking programmatically at runtime using something like this:

glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &MaxTextureUnits);

Note that there are also separate numbers for the number of allowed texture units in a vertex shader and a fragment shader. They would use the constants GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS and GL_MAX_TEXTURE_IMAGE_UNITS. The COMBINED number is the number available to both at the same time.

Upvotes: 9

Capstone
Capstone

Reputation: 2282

There is a detailed listing of all the hardware across iPhones and iPads on Apple's iOS Device Compatibility Reference

Based on this, you are safe with using upto 8 Texture units on any iOS device.

Upvotes: 2

Mārtiņš Možeiko
Mārtiņš Možeiko

Reputation: 12917

Actually the answer is in same page you linked in question:

OpenGL ES 2.0 on the PowerVR SGX

Limits

...

You can use up to 8 textures in a fragment shader. You cannot use texture lookups in a vertex shader.

....

Upvotes: 0

Related Questions