OpenGL - Should I store Attribute/Uniform locations?

Viewed 2850

Are glGetUniformLocation and glGetAttribLocation time consuming?

Which way is better?

  1. Call glGetAttribLocation or glGetUniformLocation every time I need it ?
  2. Store locations in varables and use them when needed ?
3 Answers
Related