[Mesa-stable] [PATCH 4/4] mesa: Validate the layer selection of an array texture too

Ian Romanick idr at freedesktop.org
Sun Jul 28 12:56:54 PDT 2013


From: Ian Romanick <ian.d.romanick at 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.romanick at intel.com>
Cc: mesa-stable at 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



More information about the mesa-stable mailing list