From: Ian Romanick <ian.d.roman...@intel.com>

Previously only the slice of a 3D texture was validated in the FBO
completeness check.  This fixes the failure in the 'invalid layer of an
array texture' subtest of piglit's fbo-incomplete test.

Signed-off-by: Ian Romanick <ian.d.roman...@intel.com>
Cc: mesa-sta...@lists.freedesktop.org
---
 src/mesa/main/fbobject.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index b393d91..151903b 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -731,6 +731,13 @@ test_attachment_completeness(const struct gl_context *ctx, 
GLenum format,
          att->Complete = GL_FALSE;
          return;
       }
+      if ((texObj->Target == GL_TEXTURE_2D_ARRAY
+           || texObj->Target == GL_TEXTURE_1D_ARRAY)
+          && att->Zoffset >= texImage->Depth) {
+         att_incomplete("bad array layer");
+         att->Complete = GL_FALSE;
+         return;
+      }
 
       baseFormat = _mesa_get_format_base_format(texImage->TexFormat);
 
-- 
1.8.1.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to