summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstate.c
diff options
context:
space:
mode:
authorLaura Ekstrand <laura@jlekstrand.net>2014-10-30 17:19:24 -0700
committerLaura Ekstrand <laura@jlekstrand.net>2015-01-08 11:37:28 -0800
commit77aabd8be237b68921d2e7c69fd1a0be3d36de01 (patch)
tree818af9caa403960275a6ba1e63e8c06ef9054a97 /src/mesa/main/texstate.c
parent4b381e84db5ee1a03c9b9afca2817d8bd374c0b0 (diff)
downloadexternal_mesa3d-77aabd8be237b68921d2e7c69fd1a0be3d36de01.zip
external_mesa3d-77aabd8be237b68921d2e7c69fd1a0be3d36de01.tar.gz
external_mesa3d-77aabd8be237b68921d2e7c69fd1a0be3d36de01.tar.bz2
main: Added entry point for BindTextureUnit.
The following preparations were made in texstate.c and texstate.h to better facilitate the BindTextureUnit function: Dylan Noblesmith: mesa: add _mesa_get_tex_unit() mesa: factor out _mesa_max_tex_unit() This is about to appear in a lot more places, so reduce boilerplate copy paste. add _mesa_get_tex_unit_err() checking getter function Reduce boilerplate across files. Laura Ekstrand: Made note of why BindTextureUnit should throw GL_INVALID_OPERATION if the unit is out of range. Added assert(unit > 0) to _mesa_get_tex_unit. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r--src/mesa/main/texstate.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 36eefa6..66fd718 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -290,9 +290,7 @@ _mesa_ActiveTexture(GLenum texture)
GLuint k;
GET_CURRENT_CONTEXT(ctx);
- /* See OpenGL spec for glActiveTexture: */
- k = MAX2(ctx->Const.MaxCombinedTextureImageUnits,
- ctx->Const.MaxTextureCoordUnits);
+ k = _mesa_max_tex_unit(ctx);
ASSERT(k <= Elements(ctx->Texture.Unit));