mesa: fix error value in GetFramebufferAttachmentParameteriv for OpenGL ES 3.0
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Fri, 16 Jan 2015 15:00:13 +0000 (16:00 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 3 Feb 2015 12:19:36 +0000 (13:19 +0100)
Section 6.1.13 "Framebuffer Object Queries" of OpenGL ES 3.0 spec:

 "If the default framebuffer is bound to target, then attachment must be
  BACK, identifying the color buffer; DEPTH, identifying the depth buffer; or
  STENCIL, identifying the stencil buffer."

OpenGL ES 3.0, section 2.5 (GL Errors):

 "If a command that requires an enumerated value is passed a
  symbolic constant that is not one of those specified as allowable
  for that command, an INVALID_ENUM error is generated."

Then change the returned error to INVALID_ENUM.

Fixes:

dEQP-GLES3.functional.fbo.api.attachment_query_default_fbo

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/fbobject.c

index 7d91470ed95144ea0c0202e373be761f6bd5ddb6..3305151ff2c6341409693d886d7639c52344e1f2 100644 (file)
@@ -2789,7 +2789,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
 
       if (_mesa_is_gles3(ctx) && attachment != GL_BACK &&
           attachment != GL_DEPTH && attachment != GL_STENCIL) {
-         _mesa_error(ctx, GL_INVALID_OPERATION,
+         _mesa_error(ctx, GL_INVALID_ENUM,
                      "glGetFramebufferAttachmentParameteriv(attachment)");
          return;
       }