On 06/22/2017 05:46 PM, Juan A. Suarez Romero wrote:
 From OpenGL 4.5 spec PDF, section '8.11. Texture Queries', page 236:
   "An INVALID_VALUE error is generated if texture is not the name of
    an existing texture object."

Same wording applies to the compressed version.

But turns out this is a spec bug, and Khronos is fixing it for the next
revisions.

The proposal is to return INVALID_OPERATION in these cases.

v2: Use _mesa_lookup_texture_err (Samuel Pitoiset)

Fixes: GL45-CTS.get_texture_sub_image.errors_test
Fixes: 633c959fa (getteximage: Return correct error value when texure
object is not found)

Signed-off-by: Juan A. Suarez Romero <jasua...@igalia.com>
---
  src/mesa/main/texgetimage.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 658b0e5..4937d89 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -1461,10 +1461,9 @@ _mesa_GetTextureSubImage(GLuint texture, GLint level,
     struct gl_texture_object *texObj = NULL;
if (texture > 0)
-      texObj = _mesa_lookup_texture(ctx, texture);
+      texObj = _mesa_lookup_texture_err(ctx, texture, caller);

_mesa_lookup_texture_err() already handles the case where texture > 0, you can get rid of that check (same below). Thanks.

if (!texObj) {
-      _mesa_error(ctx, GL_INVALID_VALUE, "%s(texture)", caller);
        return;
     }
@@ -1779,10 +1778,9 @@ _mesa_GetCompressedTextureSubImage(GLuint texture, GLint level,
     struct gl_texture_object *texObj = NULL;
if (texture > 0)
-      texObj = _mesa_lookup_texture(ctx, texture);
+      texObj = _mesa_lookup_texture_err(ctx, texture, caller);
if (!texObj) {
-      _mesa_error(ctx, GL_INVALID_VALUE, "%s(texture)", caller);
        return;
     }
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to