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

Kenneth Graunke kenneth at whitecape.org
Wed Mar 9 00:18:04 UTC 2016


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



More information about the mesa-dev mailing list