Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 946
Or Arbel Avatar asked Jun 03 '12 13:06

Or Arbel


2 Answers

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.

like image 178
user1118321 Avatar answered Oct 14 '22 12:10

user1118321


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.

like image 20
Capstone Avatar answered Oct 14 '22 12:10

Capstone