[Mesa-dev] [PATCH] mesa: Fix the cause of piglit test fbo-array failure

Anuj Phogat anuj.phogat at gmail.com
Fri Mar 9 18:07:17 PST 2012


Handle the special case of glFramebufferTextureLayer() for which we pass
teximage = 0 internally in framebuffer_texture(). This patch makes failing
piglit test fbo-array, fbo-depth-array to pass.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47126

Note: This is a candidate for stable branches

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

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 281b1ca..670b464 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1993,12 +1993,20 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
          }
       }
 
-      if ((level < 0) ||
-          (level >= _mesa_max_texture_levels(ctx, textarget))) {
-         _mesa_error(ctx, GL_INVALID_VALUE,
-                     "glFramebufferTexture%sEXT(level)", caller);
-         return;
-      }
+      if (target == 0)
+         if ((level < 0) ||
+             (level >= _mesa_max_texture_levels(ctx, texObj->Target))) {
+            _mesa_error(ctx, GL_INVALID_VALUE,
+                        "glFramebufferTexture%sEXT(level)", caller);
+            return;
+         }
+      else
+         if ((level < 0) ||
+             (level >= _mesa_max_texture_levels(ctx, textarget))) {
+            _mesa_error(ctx, GL_INVALID_VALUE,
+                        "glFramebufferTexture%sEXT(level)", caller);
+            return;
+         }
    }
 
    att = _mesa_get_attachment(ctx, fb, attachment);
-- 
1.7.7.6



More information about the mesa-dev mailing list