mesa: change invalid texture swizzle error to GL_INVALID_ENUM
authorBrian Paul <brianp@vmware.com>
Thu, 24 Apr 2014 20:44:03 +0000 (14:44 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 30 Apr 2014 16:09:44 +0000 (10:09 -0600)
The original GL_EXT_texture_swizzle extensions said GL_INVALID_OPERATION
was to be generated when the an invalid swizzle was passed to
glTexParameter().  But in OpenGL 3.3 and later, the error should be
GL_INVALID_ENUM.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/texparam.c

index 40790ff0ed93c6c8cab9f554d2c7d1120c216f38..dc17ea58475901706938c9bf5881a50657ce7493 100644 (file)
@@ -485,7 +485,7 @@ set_tex_parameteri(struct gl_context *ctx,
          const GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT;
          const GLint swz = comp_to_swizzle(params[0]);
          if (swz < 0) {
-            _mesa_error(ctx, GL_INVALID_OPERATION,
+            _mesa_error(ctx, GL_INVALID_ENUM,
                         "glTexParameter(swizzle 0x%x)", params[0]);
             return GL_FALSE;
          }
@@ -510,7 +510,7 @@ set_tex_parameteri(struct gl_context *ctx,
                set_swizzle_component(&texObj->_Swizzle, comp, swz);
             }
             else {
-               _mesa_error(ctx, GL_INVALID_OPERATION,
+               _mesa_error(ctx, GL_INVALID_ENUM,
                            "glTexParameter(swizzle 0x%x)", params[comp]);
                return GL_FALSE;
             }