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

Marta Lofstedt marta.lofstedt at linux.intel.com
Tue Jun 23 05:23:14 PDT 2015


From: Marta Lofstedt <marta.lofstedt at 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.lofstedt at 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



More information about the mesa-dev mailing list