summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/glformats.c
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2018-11-15 16:01:49 +0100
committerErik Faye-Lund <[email protected]>2018-12-03 18:16:44 +0100
commit1373d117c2e5d3a2a7056ee150a5704f54d3dac7 (patch)
treebd6700ccd7ee086d42566307a50cad0e94a7d7a2 /src/mesa/main/glformats.c
parente8b331ae1337cfbfe7889cf03405c8943f486a3c (diff)
mesa/main: clean up S3_s3tc check
S3_s3tc is the extension that enables this functionality on desktop, so let's check for that one. The _mesa_has_S3_s3tc() helper already verifies the API according to the extension-table. As for the second hunk, we currently already only expose EXT_texture_compression_s3tc on desktop so by using the helper instead, we get rid of this detail here, and once we enable it for GLES we'll automaticall get the interaction right. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/glformats.c')
-rw-r--r--src/mesa/main/glformats.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 9a507d11b96..a4db1ed16d4 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -1352,8 +1352,7 @@ _mesa_is_compressed_format(const struct gl_context *ctx, GLenum format)
case GL_RGB4_S3TC:
case GL_RGBA_S3TC:
case GL_RGBA4_S3TC:
- return _mesa_is_desktop_gl(ctx) &&
- ctx->Extensions.ANGLE_texture_compression_dxt;
+ return _mesa_has_S3_s3tc(ctx);
case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:
return ctx->API == API_OPENGL_COMPAT
&& ctx->Extensions.ATI_texture_compression_3dc;
@@ -1378,9 +1377,8 @@ _mesa_is_compressed_format(const struct gl_context *ctx, GLenum format)
*/
return ctx->Extensions.ANGLE_texture_compression_dxt;
} else {
- return _mesa_is_desktop_gl(ctx)
- && ctx->Extensions.EXT_texture_sRGB
- && ctx->Extensions.EXT_texture_compression_s3tc;
+ return _mesa_has_EXT_texture_sRGB(ctx) &&
+ _mesa_has_EXT_texture_compression_s3tc(ctx);
}
case MESA_FORMAT_LAYOUT_FXT1:
return _mesa_is_desktop_gl(ctx)