mesa: Fix the BindSampler unit limit.
authorHenri Verbeet <hverbeet@gmail.com>
Sun, 3 Jul 2011 22:57:43 +0000 (00:57 +0200)
committerHenri Verbeet <hverbeet@gmail.com>
Thu, 7 Jul 2011 18:30:13 +0000 (20:30 +0200)
I'm not sure about this one. The current code actually follows the spec, but
considering the spec is supposed to be written against GL 3.2 I'd say the spec
is broken. I filled out a spec feedback form over a month ago, but either the
form is broken, or nobody cares.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/samplerobj.c

index f7774fdd7cb48e062b8bd4d8a4a16f74f96fa1a7..8f8d87b90e8ffa1996ccc9bddae47e0fc2c9fcf0 100644 (file)
@@ -251,7 +251,7 @@ _mesa_BindSampler(GLuint unit, GLuint sampler)
    struct gl_sampler_object *sampObj;
    GET_CURRENT_CONTEXT(ctx);
 
-   if (unit >= ctx->Const.MaxTextureImageUnits) {
+   if (unit >= ctx->Const.MaxCombinedTextureImageUnits) {
       _mesa_error(ctx, GL_INVALID_VALUE, "glBindSampler(unit %u)", unit);
       return;
    }