mesa: Fix error code for glTexParameteri of TEXTURE_MAX_LEVEL.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 8 Nov 2012 10:24:08 +0000 (02:24 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 19 Nov 2012 19:48:52 +0000 (11:48 -0800)
Calling glTexParameteri() with pname GL_TEXTURE_MAX_LEVEL and either a
target of GL_TEXTURE_RECTANGLE or a negative value previously generated
GL_INVALID_OPERATION.  However, GL_INVALID_VALUE seems more appropriate.

Fixes oglconform's api-error/negative.glTexParameter and es3conform's
sgis_texture_lod_basic_error.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
src/mesa/main/texparam.c

index 8ce0546180ca12685bde6267bc901a798aeb1839..92c89102f374496ee458edebd409c2eab581a47b 100644 (file)
@@ -349,7 +349,7 @@ set_tex_parameteri(struct gl_context *ctx,
       if (texObj->MaxLevel == params[0])
          return GL_FALSE;
       if (params[0] < 0 || texObj->Target == GL_TEXTURE_RECTANGLE_ARB) {
-         _mesa_error(ctx, GL_INVALID_OPERATION,
+         _mesa_error(ctx, GL_INVALID_VALUE,
                      "glTexParameter(param=%d)", params[0]);
          return GL_FALSE;
       }