mesa: Add the infrastructure for KHR_texture_compression_astc_sliced_3d
authorAnuj Phogat <anuj.phogat@gmail.com>
Fri, 8 Jul 2016 00:03:19 +0000 (17:03 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Mon, 18 Jul 2016 21:39:54 +0000 (14:39 -0700)
V2: Drop the changes to gl.xml.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
src/mesa/main/extensions_table.h
src/mesa/main/mtypes.h
src/mesa/main/teximage.c

index ad3bffc068a0584fc88c81321d8073743cd67602..6c47b3b1e793d104eadf0396689a74574f8d7bb8 100644 (file)
@@ -285,6 +285,7 @@ EXT(KHR_robust_buffer_access_behavior       , ARB_robust_buffer_access_behavior
 EXT(KHR_robustness                          , KHR_robustness                         , GLL, GLC,  x , ES2, 2012)
 EXT(KHR_texture_compression_astc_hdr        , KHR_texture_compression_astc_hdr       , GLL, GLC,  x , ES2, 2012)
 EXT(KHR_texture_compression_astc_ldr        , KHR_texture_compression_astc_ldr       , GLL, GLC,  x , ES2, 2012)
+EXT(KHR_texture_compression_astc_sliced_3d  , KHR_texture_compression_astc_sliced_3d , GLL, GLC,  x , ES2, 2015)
 
 EXT(MESA_pack_invert                        , MESA_pack_invert                       , GLL, GLC,  x ,  x , 2002)
 EXT(MESA_texture_signed_rgba                , EXT_texture_snorm                      , GLL, GLC,  x ,  x , 2009)
index 3dae16895a23f4f33044f962cb6518ec4430d519..ecc5b49073d5848c99134ba6c5a35f6c80f10585 100644 (file)
@@ -3946,6 +3946,7 @@ struct gl_extensions
    GLboolean KHR_robustness;
    GLboolean KHR_texture_compression_astc_hdr;
    GLboolean KHR_texture_compression_astc_ldr;
+   GLboolean KHR_texture_compression_astc_sliced_3d;
    GLboolean MESA_pack_invert;
    GLboolean MESA_ycbcr_texture;
    GLboolean NV_conditional_render;
index d74a45fb815f59b9163de751f3b971e30d25a6b2..8869b3db38959dfa8572d05ac604144d9825cc28 100644 (file)
@@ -1447,11 +1447,12 @@ _mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,
          break;
       case MESA_FORMAT_LAYOUT_ASTC:
          target_can_be_compresed =
-                             ctx->Extensions.KHR_texture_compression_astc_hdr;
+            ctx->Extensions.KHR_texture_compression_astc_hdr ||
+            ctx->Extensions.KHR_texture_compression_astc_sliced_3d;
 
          /* Throw an INVALID_OPERATION error if the target is TEXTURE_3D and
-          * and the hdr extension is not supported.
-          * See comment in switch case GL_TEXTURE_CUBE_MAP_ARRAY for more info.
+          * neither of the above extensions are supported. See comment in
+          * switch case GL_TEXTURE_CUBE_MAP_ARRAY for more info.
           */
          if (!target_can_be_compresed)
             return write_error(error, GL_INVALID_OPERATION);