Re: [Mesa-dev] [PATCH v3] Revert "getteximage: Return correct error value when texure object is not found"

2017-06-22 Thread Samuel Pitoiset

Yeah, looks better.

Reviewed-by: Samuel Pitoiset 

On 06/22/2017 06:19 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.

This reverts commit 633c959faeae5099fd095f27da7b954e4a36254b.

v2:
- Use _mesa_lookup_texture_err (Samuel Pitoiset)

v3:
- _mesa_lookup_texture_err() already handles texture > 0 (Samuel
Pitoiset)
- Just revert 633c959fae (Juan A. Suarez)

Signed-off-by: Juan A. Suarez Romero 
---
  src/mesa/main/texgetimage.c | 12 +++-
  1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 658b0e5..715bc24 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -1458,13 +1458,10 @@ _mesa_GetTextureSubImage(GLuint texture, GLint level,
  {
 GET_CURRENT_CONTEXT(ctx);
 static const char *caller = "glGetTextureSubImage";
-   struct gl_texture_object *texObj = NULL;
-
-   if (texture > 0)
-  texObj = _mesa_lookup_texture(ctx, texture);
+   struct gl_texture_object *texObj =
+  _mesa_lookup_texture_err(ctx, texture, caller);
  
 if (!texObj) {

-  _mesa_error(ctx, GL_INVALID_VALUE, "%s(texture)", caller);
return;
 }
  
@@ -1778,11 +1775,8 @@ _mesa_GetCompressedTextureSubImage(GLuint texture, GLint level,

 static const char *caller = "glGetCompressedTextureImage";
 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


[Mesa-dev] [PATCH v3] Revert "getteximage: Return correct error value when texure object is not found"

2017-06-22 Thread Juan A. Suarez Romero
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.

This reverts commit 633c959faeae5099fd095f27da7b954e4a36254b.

v2:
- Use _mesa_lookup_texture_err (Samuel Pitoiset)

v3:
- _mesa_lookup_texture_err() already handles texture > 0 (Samuel
Pitoiset)
- Just revert 633c959fae (Juan A. Suarez)

Signed-off-by: Juan A. Suarez Romero 
---
 src/mesa/main/texgetimage.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 658b0e5..715bc24 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -1458,13 +1458,10 @@ _mesa_GetTextureSubImage(GLuint texture, GLint level,
 {
GET_CURRENT_CONTEXT(ctx);
static const char *caller = "glGetTextureSubImage";
-   struct gl_texture_object *texObj = NULL;
-
-   if (texture > 0)
-  texObj = _mesa_lookup_texture(ctx, texture);
+   struct gl_texture_object *texObj =
+  _mesa_lookup_texture_err(ctx, texture, caller);
 
if (!texObj) {
-  _mesa_error(ctx, GL_INVALID_VALUE, "%s(texture)", caller);
   return;
}
 
@@ -1778,11 +1775,8 @@ _mesa_GetCompressedTextureSubImage(GLuint texture, GLint 
level,
static const char *caller = "glGetCompressedTextureImage";
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;
}
 
-- 
2.9.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev