* proper value for this, but rather returns 0. The GL(ES) specification
* mandates a minimum value of 2, so use this as a fall-back value.
*/
- max_units = std::min(max_units, 2);
+ max_units = std::max(max_units, 2);
for (GLint unit = 0; unit < max_units; ++unit) {
GLenum texture = GL_TEXTURE0 + unit;