mesa: expose EXT_texture_compression_s3tc on GLES
authorMarek Olšák <marek.olsak@amd.com>
Mon, 6 Aug 2018 02:50:54 +0000 (22:50 -0400)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 30 Oct 2018 12:31:00 +0000 (13:31 +0100)
The spec was modified to support GLES.

Tested-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
docs/relnotes/18.3.0.html
src/mesa/main/extensions_table.h
src/mesa/main/glformats.c

index 5874d3fa330145156271b14b937407d4e5fb57c6..e0061872de4f046f841bcbcd72426dd8a765bd43 100644 (file)
@@ -57,6 +57,7 @@ Note: some of the new features are only available with certain drivers.
 <li>GL_AMD_multi_draw_indirect on all GL 4.x drivers.</li>
 <li>GL_AMD_query_buffer_object on i965, nvc0, r600, radeonsi.</li>
 <li>GL_EXT_disjoint_timer_query on radeonsi and most other Gallium drivers (ES extension)</li>
+<li>GL_EXT_texture_compression_s3tc on all drivers (ES extension)<li>
 <li>GL_EXT_vertex_attrib_64bit on i965, nvc0, radeonsi.</li>
 <li>GL_EXT_window_rectangles on radeonsi.</li>
 <li>GL_KHR_texture_compression_astc_sliced_3d on radeonsi.</li>
index 09bf923bd0e00f0099eacee27ae02c3a1baa8b8d..47db15831352c174d0cf6a641c5a8efa1f2e0caa 100644 (file)
@@ -278,7 +278,7 @@ EXT(EXT_texture_buffer                      , OES_texture_buffer
 EXT(EXT_texture_compression_dxt1            , ANGLE_texture_compression_dxt          , GLL, GLC, ES1, ES2, 2004)
 EXT(EXT_texture_compression_latc            , EXT_texture_compression_latc           , GLL,  x ,  x ,  x , 2006)
 EXT(EXT_texture_compression_rgtc            , ARB_texture_compression_rgtc           , GLL, GLC,  x ,  x , 2004)
-EXT(EXT_texture_compression_s3tc            , EXT_texture_compression_s3tc           , GLL, GLC,  x ,  x , 2000)
+EXT(EXT_texture_compression_s3tc            , EXT_texture_compression_s3tc           , GLL, GLC,  x , ES2, 2000)
 EXT(EXT_texture_cube_map                    , ARB_texture_cube_map                   , GLL,  x ,  x ,  x , 2001)
 EXT(EXT_texture_cube_map_array              , OES_texture_cube_map_array             ,  x ,  x ,  x ,  31, 2014)
 EXT(EXT_texture_edge_clamp                  , dummy_true                             , GLL,  x ,  x ,  x , 1997)
index 6cb3435dea23afb2dfc600ca5e9a5d3b5b99bba8..f8fc36e93117927584cc2f07ff5317b3b152d06a 100644 (file)
@@ -2803,6 +2803,17 @@ _mesa_es3_error_check_format_and_type(const struct gl_context *ctx,
       internalFormat = effectiveInternalFormat;
    }
 
+   /* The GLES variant of EXT_texture_compression_s3tc is very vague and
+    * doesn't list valid types. Just do exactly what the spec says.
+    */
+   if (ctx->Extensions.EXT_texture_compression_s3tc &&
+       (internalFormat == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
+        internalFormat == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT ||
+        internalFormat == GL_COMPRESSED_RGBA_S3TC_DXT3_EXT ||
+        internalFormat == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT))
+      return format == GL_RGB || format == GL_RGBA ? GL_NO_ERROR :
+                                                     GL_INVALID_OPERATION;
+
    switch (format) {
    case GL_BGRA_EXT:
       if (type != GL_UNSIGNED_BYTE || internalFormat != GL_BGRA)