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

Matt Turner mattst88 at gmail.com
Tue Jun 23 13:53:57 PDT 2015


On Tue, Jun 23, 2015 at 5:23 AM, Marta Lofstedt
<marta.lofstedt at linux.intel.com> wrote:
> 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)

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;
>     }
> --


More information about the mesa-dev mailing list