[Mesa-dev] [PATCH 2/2] mesa: Only allow queries of window system FBO on desktop GL w/ARB_fbo

Ian Romanick idr at freedesktop.org
Tue Oct 4 12:32:03 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

Neither OES_framebuffer_object nor EXT_framebuffer_object allow
querying the window system FBO.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/main/fbobject.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index e3d3e1c..800017f 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2216,6 +2216,21 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
    }
 
    if (is_winsys_fbo(buffer)) {
+      /* Page 126 (page 136 of the PDF) of the OpenGL ES 2.0.25 spec
+       * says:
+       *
+       *     "If the framebuffer currently bound to target is zero, then
+       *     INVALID_OPERATION is generated."
+       *
+       * The EXT_framebuffer_object spec has the same wording, and the
+       * OES_framebuffer_object spec refers to the EXT_framebuffer_object
+       * spec.
+       */
+      if (ctx->API != API_OPENGL || !ctx->Extensions.ARB_framebuffer_object) {
+	 _mesa_error(ctx, GL_INVALID_OPERATION,
+		     "glGetFramebufferAttachmentParameteriv(bound FBO = 0)");
+	 return;
+      }
       /* the default / window-system FBO */
       att = _mesa_get_fb0_attachment(ctx, buffer, attachment);
    }
-- 
1.7.6



More information about the mesa-dev mailing list