mesa: another target fix in compressed_subtexture_target_check()
authorBrian Paul <brianp@vmware.com>
Wed, 22 Jul 2015 13:42:12 +0000 (07:42 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 24 Jul 2015 02:19:50 +0000 (20:19 -0600)
The previous fix added GL_TEXTURE_CUBE_MAP_ARRAY but we also need
to support GL_TEXTURE_CUBE_MAP (via DSA).

So in the end, GL_TEXTURE_3D is the only (legal) target for
glCompressedTex*SubImage3D() which needs additional compression
format checking.  GL_TEXTURE_2D_ARRAY, GL_TEXTURE_CUBE_MAP_ARRAY
and GL_TEXTURE_CUBE_MAP are basically 2D images which support all
compressed formats.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/mesa/main/teximage.c

index 4fe6ee4f3054cbac276b1e5cbf7a5cd407d8055a..0726758076f5962e4f20b3c7e9c43e8e176124b0 100644 (file)
@@ -4581,12 +4581,19 @@ compressed_subtexture_target_check(struct gl_context *ctx, GLenum target,
        *    one of the EAC, ETC2, or RGTC formats and either border is
        *    non-zero, or the effective target for the texture is not
        *    TEXTURE_2D_ARRAY."
+       *
+       * NOTE: that's probably a spec error.  It should probably say
+       *    "... or the effective target for the texture is not
+       *    TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP, nor GL_TEXTURE_CUBE_MAP_ARRAY."
+       * since those targets are 2D images and they support all compression
+       * formats.
+       *
        * Instead of listing all these, just list those which are allowed,
        * which is (at this time) only bptc. Otherwise we'd say s3tc (and more)
        * are valid here, which they are not, but of course not mentioned by
        * core spec.
        */
-      if (target != GL_TEXTURE_2D_ARRAY && target != GL_TEXTURE_CUBE_MAP_ARRAY) {
+      if (target == GL_TEXTURE_3D) {
          switch (format) {
          /* These are the only 3D compression formats supported at this time */
          case GL_COMPRESSED_RGBA_BPTC_UNORM: