Mesa (master): texobj: Fix the completeness checks for cube textures

Neil Roberts nroberts at kemper.freedesktop.org
Thu Jan 21 21:46:57 UTC 2016


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

Author: Neil Roberts <neil at linux.intel.com>
Date:   Thu Jan 21 17:12:29 2016 +0000

texobj: Fix the completeness checks for cube textures

According to the GL 1.4 spec section 3.8.10, a cubemap texture is only
complete if:

• The level base arrays of each of the six texture images making up
  the cube map have identical, positive, and square dimensions.
• The level base arrays were each specified with the same internal
  format.
• The level base arrays each have the same border width.

Previously the texture completeness code was only checking the first
point. This patch makes it additionally check the other two.

This fixes the following two dEQP tests:

deqp-gles2.functional.texture.completeness.cube.format_mismatch_rgba_rgb_level_0_neg_z
deqp-gles2.functional.texture.completeness.cube.format_mismatch_rgb_rgba_level_0_pos_z

And also this Piglit test:

spec/!opengl 2.0/incomplete-cubemap-format

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93792
Cc: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/main/texobj.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index b107a8f..9ce7b4c 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -769,7 +769,8 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
    }
 
    if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) {
-      /* Make sure that all six cube map level 0 images are the same size.
+      /* Make sure that all six cube map level 0 images are the same size and
+       * format.
        * Note:  we know that the image's width==height (we enforce that
        * at glTexImage time) so we only need to test the width here.
        */
@@ -784,6 +785,15 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
             incomplete(t, BASE, "Cube face missing or mismatched size");
             return;
          }
+         if (t->Image[face][baseLevel]->InternalFormat !=
+             baseImage->InternalFormat) {
+            incomplete(t, BASE, "Cube face format mismatch");
+            return;
+         }
+         if (t->Image[face][baseLevel]->Border != baseImage->Border) {
+            incomplete(t, BASE, "Cube face border size mismatch");
+            return;
+         }
       }
    }
 




More information about the mesa-commit mailing list