[Mesa-dev] [PATCH] mesa: Raise GL_INVALID_ENUM for bad textarget in FramebufferTexture*D

Ilia Mirkin imirkin at alum.mit.edu
Wed Mar 9 00:22:18 UTC 2016


Actually I filed a dEQP bug for that one:

https://code.google.com/p/android/issues/detail?id=200911

The text says "An INVALID_OPERATION error is generated if texture is
not zero and textarget is not one of TEXTURE_2D,
TEXTURE_2D_MULTISAMPLE, or one of the cube map face targets from table
8.21". At least that was in GLES 3.1.

  -ilia


On Tue, Mar 8, 2016 at 7:18 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> dEQP-GLES3.functional.negative_api.buffer.framebuffer_texture2d
> expects glFramebufferTexture[123]D to raise GL_INVALID_ENUM when
> supplied a completely bogus textarget parameter (i.e. 0xffffffff).
>
> This patch changes our behavior from GL_INVALID_OPERATION to
> GL_INVALID_ENUM in this case.  The spec isn't particularly clear,
> but given GL's general guideline that bogus enumeration values
> translate into GL_INVALID_ENUM, it makes sense.
>
> Note that we keep raising GL_INVALID_OPERATION when supplied with
> a textarget enum that is valid, but doesn't match the texture, as
> required by the spec.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/main/fbobject.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index d490918..0eec9d9 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -3017,7 +3017,7 @@ check_textarget(struct gl_context *ctx, int dims, GLenum target,
>     }
>
>     if (err) {
> -      _mesa_error(ctx, GL_INVALID_OPERATION,
> +      _mesa_error(ctx, GL_INVALID_ENUM,
>                    "%s(invalid textarget %s)",
>                    caller, _mesa_enum_to_string(textarget));
>        return false;
> --
> 2.7.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list