Mesa (master): mesa: add check that non base level attachment is mipmap complete

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Mar 1 08:38:40 UTC 2021


Module: Mesa
Branch: master
Commit: 2683e3b241b9a652de64e545cc7d17fb3968e74d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2683e3b241b9a652de64e545cc7d17fb3968e74d

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Tue Jan 19 07:43:41 2021 +0200

mesa: add check that non base level attachment is mipmap complete

Patch adds a check for mipmap completeness of framebuffer object texture
attachments. Since a glTexImage call might have updated miplevels
meanwhile, we test the completeness before setting framebuffer object
incomplete.

Fixes some upcoming framebuffer completeness CTS tests that explicitly
test case where we have mipmap incomplete non base level texture which
should make also framebuffer object incomplete. After update to the
texture it should make framebuffer object complete again.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8520>

---

 src/mesa/main/fbobject.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 2bfe2e9de6a..37087519f97 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -920,6 +920,21 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format,
          att->Complete = GL_FALSE;
          return;
       }
+
+      /* Mutable non base level texture as framebuffer attachment
+       * must be mipmap complete.
+       */
+      if (texImage->Level > texObj->Attrib.BaseLevel &&
+          !texObj->_MipmapComplete) {
+         /* Test if texture has become mipmap complete meanwhile. */
+         _mesa_test_texobj_completeness(ctx, att->Texture);
+         if (!texObj->_MipmapComplete) {
+            att_incomplete("texture attachment not mipmap complete");
+            att->Complete = GL_FALSE;
+            return;
+         }
+      }
+
       if (texImage->Width < 1 || texImage->Height < 1) {
          att_incomplete("teximage width/height=0");
          att->Complete = GL_FALSE;



More information about the mesa-commit mailing list