summaryrefslogtreecommitdiff
path: root/src/mesa/main/texparam.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-02-03 15:47:44 -0700
committerBrian Paul <brianp@vmware.com>2010-02-03 15:48:42 -0700
commitb2a30497cc8b107ea74c3d8fbb646e59a4d55a05 (patch)
tree1d89d956ae90df4a63dd8167a2063ec8828afffd /src/mesa/main/texparam.c
parentea81daf9544205b892926bdbbcdfdfc63fd7d872 (diff)
mesa: increase number of texture units to MAX_COMBINED_TEXTURE_IMAGE_UNITS
We were misinterpretting GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS previously. It's the number of texture units for which we need to keep state; not just the total number of texture units addressable by the vertex shader plus fragment shader. Since sw Mesa independently supports 16 texture units in vertex shaders and 16 texture units in fragment shaders, the max combined units is 32. Note that the docs for glActiveTexture() indicate the max legal unit is MAX(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, MAX_TEXTURE_COORDS) - 1. A new piglit test (texunits.c) tests the various texture unit limits. I'm pretty sure I've got this all right now, but additional reviews are welcome...
Diffstat (limited to 'src/mesa/main/texparam.c')
-rw-r--r--src/mesa/main/texparam.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index c4f2495018..0fde89b507 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -87,7 +87,7 @@ get_texobj(GLcontext *ctx, GLenum target, GLboolean get)
{
struct gl_texture_unit *texUnit;
- if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) {
+ if (ctx->Texture.CurrentUnit >= ctx->Const.MaxCombinedTextureImageUnits) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"gl%sTexParameter(current unit)", get ? "Get" : "");
return NULL;
@@ -815,7 +815,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) {
+ if (ctx->Texture.CurrentUnit >= ctx->Const.MaxCombinedTextureImageUnits) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetTexLevelParameteriv(current unit)");
return;