summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/glformats.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-08-05 22:50:54 -0400
committerErik Faye-Lund <[email protected]>2018-10-30 13:31:00 +0100
commita09cbaffbfb1dcf0b6ae41bbba21ae9bfdfb8a3b (patch)
treef9322370d2ff430e349cd6e98d6837d527732152 /src/mesa/main/glformats.c
parent2734baa9e24fc9401fab2a116fcfb18c56538175 (diff)
mesa: expose EXT_texture_compression_s3tc on GLES
The spec was modified to support GLES. Tested-by: Erik Faye-Lund <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/mesa/main/glformats.c')
-rw-r--r--src/mesa/main/glformats.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 6cb3435dea2..f8fc36e9311 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -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)