Re: [Mesa-dev] [PATCH 4/6] mesa/es3.1 : Correct error code for defect texture target

2015-06-23 Thread Erik Faye-Lund
On Tue, Jun 23, 2015 at 2:23 PM, Marta Lofstedt
marta.lofst...@linux.intel.com wrote:
 From: Marta Lofstedt marta.lofst...@intel.com

 According to GLES 3.1 CTS test:
 ES31-CTS.texture_storage_multisample.
 APIGLGetTexLevelParameterifv.
 invalid_texture_target_rejected:

 GL_INVALID_ENUM should be generated when
 glGetTexLevelParameteriv is called with a defect
 texture target.


Again, this is defined by the spec, not the CTS, section 8.10.3:

An INVALID_ENUM error is generated if target is not one of the
texture targets described above

But The OpenGL 4.5 spec defines the exact same error, so I don't think
we should check for gles3.1 here.

 Signed-off-by: Marta Lofstedt marta.lofst...@linux.intel.com
 ---
  src/mesa/main/texobj.c | 11 +++
  1 file changed, 11 insertions(+)

 diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
 index c563f1e..c239deb 100644
 --- a/src/mesa/main/texobj.c
 +++ b/src/mesa/main/texobj.c
 @@ -222,6 +222,17 @@ _mesa_get_current_tex_object(struct gl_context *ctx, 
 GLenum target)
   return ctx-Extensions.ARB_texture_multisample
  ? ctx-Texture.ProxyTex[TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX] : 
 NULL;
default:
 + if(_mesa_is_gles31(ctx))
 + {
 +/*
 + * According to OpenGL ES 3.1 CTS:
 + * 
 ES31-CTS.texture_storage_multisample.APIGLGetTexLevelParameterifv.
 + * invalid_value_argument_rejected
 + * 
 es31cTextureStorageMultisampleGetTexLevelParameterifvTests.cpp:1277
 + * INVALID_ENUM should be reported for bad targets.
 + */
 +_mesa_error(ctx, GL_INVALID_ENUM, %s(target), __func__);
 + }
   _mesa_problem(NULL, bad target in _mesa_get_current_tex_object());
   return NULL;
 }
 --
 1.9.1

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


Re: [Mesa-dev] [PATCH 4/6] mesa/es3.1 : Correct error code for defect texture target

2015-06-23 Thread Matt Turner
On Tue, Jun 23, 2015 at 5:23 AM, Marta Lofstedt
marta.lofst...@linux.intel.com wrote:
 From: Marta Lofstedt marta.lofst...@intel.com

 According to GLES 3.1 CTS test:
 ES31-CTS.texture_storage_multisample.
 APIGLGetTexLevelParameterifv.
 invalid_texture_target_rejected:

 GL_INVALID_ENUM should be generated when
 glGetTexLevelParameteriv is called with a defect
 texture target.

 Signed-off-by: Marta Lofstedt marta.lofst...@linux.intel.com
 ---
  src/mesa/main/texobj.c | 11 +++
  1 file changed, 11 insertions(+)

 diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
 index c563f1e..c239deb 100644
 --- a/src/mesa/main/texobj.c
 +++ b/src/mesa/main/texobj.c
 @@ -222,6 +222,17 @@ _mesa_get_current_tex_object(struct gl_context *ctx, 
 GLenum target)

Since this function is called internally from a lot of places, it's
not clear to me that it's appropriate to raise a GL error here, but
I'm not sure.

For instance, it's called by TexSubImage, and the spec says for TexSubImage...

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

   return ctx-Extensions.ARB_texture_multisample
  ? ctx-Texture.ProxyTex[TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX] : 
 NULL;
default:
 + if(_mesa_is_gles31(ctx))

Not specific to ES 3.1.

Commit message needs to be improved.

 + {

{ goes on the line with the if, like the rest of Mesa.

 +/*
 + * According to OpenGL ES 3.1 CTS:
 + * 
 ES31-CTS.texture_storage_multisample.APIGLGetTexLevelParameterifv.
 + * invalid_value_argument_rejected
 + * 
 es31cTextureStorageMultisampleGetTexLevelParameterifvTests.cpp:1277
 + * INVALID_ENUM should be reported for bad targets.

Like Erik says, need an actual spec citation.

 + */
 +_mesa_error(ctx, GL_INVALID_ENUM, %s(target), __func__);
 + }
   _mesa_problem(NULL, bad target in _mesa_get_current_tex_object());
   return NULL;
 }
 --
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev