[Mesa-dev] [PATCH 5/6] mesa: Fix GL error generation in _mesa_GetFramebufferAttachmentParameteriv()

Anuj Phogat anuj.phogat at gmail.com
Wed Dec 12 15:25:50 PST 2012


This allows query on default framebuffer in glGetFramebufferAttachmentParameteriv()
for gles3. Fixes unexpected GL errors in gles3 conformance test case:
framebuffer_blit_functionality_multisampled_to_singlesampled_blit

Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
 src/mesa/main/fbobject.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 9e32836..d87239e 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -250,6 +250,7 @@ _mesa_get_fb0_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
       return &fb->Attachment[BUFFER_FRONT_LEFT];
    case GL_FRONT_RIGHT:
       return &fb->Attachment[BUFFER_FRONT_RIGHT];
+   case GL_BACK:
    case GL_BACK_LEFT:
       return &fb->Attachment[BUFFER_BACK_LEFT];
    case GL_BACK_RIGHT:
@@ -2369,7 +2370,8 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
        * OES_framebuffer_object spec refers to the EXT_framebuffer_object
        * spec.
        */
-      if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_framebuffer_object) {
+      if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_framebuffer_object)
+          && !_mesa_is_gles3(ctx)) {
 	 _mesa_error(ctx, GL_INVALID_OPERATION,
 		     "glGetFramebufferAttachmentParameteriv(bound FBO = 0)");
 	 return;
-- 
1.7.7.6



More information about the mesa-dev mailing list