[Mesa-dev] [PATCH 11/11] mesa: fix error value in GetFramebufferAttachmentParameteriv for OpenGL ES 3.0

Eduardo Lima Mitev elima at igalia.com
Mon Jan 19 03:32:17 PST 2015


From: Samuel Iglesias Gonsalvez <siglesias at igalia.com>

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."

But the spec doesn't state which kind of error to return. GL_EXT_draw_buffers,
section "Errors" says the following:

  "The INVALID_ENUM error is generated by GetFramebufferAttachmentParameteriv
   if the <attachment> parameter is not one of the values listed in Table 4.x."

Due to the ambiguity of OpenGL ES 3.0 spec on this regard and because
GL_EXT_draw_buffers returns INVALID_ENUM in a related case, then
change the returned error to INVALID_ENUM.

More info:

http://lists.freedesktop.org/archives/mesa-dev/2015-January/074447.html

Fixes:

dEQP-GLES3.functional.fbo.api.attachment_query_default_fbo

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
---
 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 80dc353..99ecee8 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2790,7 +2790,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;
       }
-- 
2.1.3



More information about the mesa-dev mailing list