cogl: Cache the value for GL_MAX_TEXTURE_UNITS
authorNeil Roberts <neil@linux.intel.com>
Fri, 12 Feb 2010 14:26:33 +0000 (14:26 +0000)
committerNeil Roberts <neil@linux.intel.com>
Fri, 12 Feb 2010 14:38:53 +0000 (14:38 +0000)
commit7a372bc0011b6301cc8b46767493a23218a67cff
tree74717b92b42a5bf49b81f88f8a9d11925e0ddf41
parent22c33b2fea1fd60239280aa1f4fd112f533688aa
cogl: Cache the value for GL_MAX_TEXTURE_UNITS

The function _cogl_get_max_texture_units is called quite often while
rendering and it returns a constant value so we might as well cache
the result. Calling glGetInteger on Mesa can be expensive because it
flushes a lot of state.
clutter/cogl/cogl/cogl-context.c
clutter/cogl/cogl/cogl-context.h
clutter/cogl/cogl/cogl.c