mesa: change error code of *TextureSubImage* for incorreect target
authorYevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Thu, 16 Jul 2020 12:13:08 +0000 (15:13 +0300)
committerMarge Bot <eric+marge@anholt.net>
Mon, 20 Jul 2020 19:58:14 +0000 (19:58 +0000)
According to the "Errors" list of the OpenGL 4.6 spec, section 8.6
"Alternate Texture Image Specification Commands":

An INVALID_OPERATION error is generated by *TextureSubImage* if the
effective target of texture does not match the command, as shown in table 8.15.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5934>

src/mesa/main/teximage.c

index decd67147e512dc58fdeb4186478c970f5fc2b25..7a74ff251068757680439d8c19e4e8d85ef8810b 100644 (file)
@@ -3703,7 +3703,7 @@ texturesubimage(struct gl_context *ctx, GLuint dims,
    if (!no_error) {
       /* check target (proxies not allowed) */
       if (!legal_texsubimage_target(ctx, dims, texObj->Target, true)) {
-         _mesa_error(ctx, GL_INVALID_ENUM, "%s(target=%s)",
+         _mesa_error(ctx, GL_INVALID_OPERATION, "%s(target=%s)",
                      callerName, _mesa_enum_to_string(texObj->Target));
          return;
       }