Mesa (master): mesa/main: *TextureSubImage* generates INVALID_OPERATION on wrong target

Alejandro Pinheiro apinheiro at kemper.freedesktop.org
Fri Mar 3 07:19:04 UTC 2017


Module: Mesa
Branch: master
Commit: a54f0ad6d3217394e597ea66b9a71a6584532638
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a54f0ad6d3217394e597ea66b9a71a6584532638

Author: Alejandro Piñeiro <apinheiro at igalia.com>
Date:   Thu Mar  2 17:18:14 2017 +0100

mesa/main: *TextureSubImage* generates INVALID_OPERATION on wrong target

Equivalent *TexSubImage* methods generates INVALID_ENUM.

>From OpenGL 4.5 spec, section 8.6 Alternate Texture Image
Specification Commands:

   "An INVALID_ENUM error is generated by *TexSubImage* if target does
    not match the command, as shown in table 8.15."

And:

   "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."

Fixes:
GL45-CTS.direct_state_access.textures_copy_errors

v2: slightly change commit summary (Samuel)

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

---

 src/mesa/main/teximage.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 25c5f82..89f6921 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -3939,7 +3939,7 @@ _mesa_CopyTextureSubImage1D(GLuint texture, GLint level,
 
    /* Check target (proxies not allowed). */
    if (!legal_texsubimage_target(ctx, 1, texObj->Target, true)) {
-      _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
+      _mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid target %s)", self,
                   _mesa_enum_to_string(texObj->Target));
       return;
    }
@@ -3963,7 +3963,7 @@ _mesa_CopyTextureSubImage2D(GLuint texture, GLint level,
 
    /* Check target (proxies not allowed). */
    if (!legal_texsubimage_target(ctx, 2, texObj->Target, true)) {
-      _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
+      _mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid target %s)", self,
                   _mesa_enum_to_string(texObj->Target));
       return;
    }
@@ -3990,7 +3990,7 @@ _mesa_CopyTextureSubImage3D(GLuint texture, GLint level,
 
    /* Check target (proxies not allowed). */
    if (!legal_texsubimage_target(ctx, 3, texObj->Target, true)) {
-      _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
+      _mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid target %s)", self,
                   _mesa_enum_to_string(texObj->Target));
       return;
    }




More information about the mesa-commit mailing list