OpenGL - Should I store Attribute/Uniform locations?
问题 Are glGetUniformLocation and glGetAttribLocation time consuming? Which way is better? Call glGetAttribLocation or glGetUniformLocation every time I need it ? Store locations in varables and use them when needed ? 回答1: Whether on Android or iPhone, for an opengl surface you will have methods like: onSurfaceCreated and onSurfaceChanged , get into the habit of fetching uniforms and attributes here in these 2 methods. The only way you can make rendering faster (which will soon become your