From b3462c12542a69eeaa3fe90fddfbb15d30c18158 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 27 Aug 2012 08:17:50 +0200 Subject: xwininfo fontconfig libX11 libXau libXext libxcb mesa pixman xkeyboard-config git update 27 Aug 2012 --- mesalib/src/mesa/main/glformats.c | 63 ++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 8 deletions(-) (limited to 'mesalib/src/mesa/main/glformats.c') diff --git a/mesalib/src/mesa/main/glformats.c b/mesalib/src/mesa/main/glformats.c index daf1b7667..2d06cb715 100644 --- a/mesalib/src/mesa/main/glformats.c +++ b/mesalib/src/mesa/main/glformats.c @@ -790,37 +790,45 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format) switch (format) { case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: + return ctx->Extensions.EXT_texture_compression_s3tc; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return ctx->Extensions.EXT_texture_compression_s3tc; + return _mesa_is_desktop_gl(ctx) + && ctx->Extensions.EXT_texture_compression_s3tc; case GL_RGB_S3TC: case GL_RGB4_S3TC: case GL_RGBA_S3TC: case GL_RGBA4_S3TC: - return ctx->Extensions.S3_s3tc; + return _mesa_is_desktop_gl(ctx) && ctx->Extensions.S3_s3tc; case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - return ctx->Extensions.EXT_texture_sRGB + return _mesa_is_desktop_gl(ctx) + && ctx->Extensions.EXT_texture_sRGB && ctx->Extensions.EXT_texture_compression_s3tc; case GL_COMPRESSED_RGB_FXT1_3DFX: case GL_COMPRESSED_RGBA_FXT1_3DFX: - return ctx->Extensions.TDFX_texture_compression_FXT1; + return _mesa_is_desktop_gl(ctx) + && ctx->Extensions.TDFX_texture_compression_FXT1; case GL_COMPRESSED_RED_RGTC1: case GL_COMPRESSED_SIGNED_RED_RGTC1: case GL_COMPRESSED_RG_RGTC2: case GL_COMPRESSED_SIGNED_RG_RGTC2: - return ctx->Extensions.ARB_texture_compression_rgtc; + return _mesa_is_desktop_gl(ctx) + && ctx->Extensions.ARB_texture_compression_rgtc; case GL_COMPRESSED_LUMINANCE_LATC1_EXT: case GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT: case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT: case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT: - return ctx->Extensions.EXT_texture_compression_latc; + return ctx->API == API_OPENGL + && ctx->Extensions.EXT_texture_compression_latc; case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI: - return ctx->Extensions.ATI_texture_compression_3dc; + return ctx->API == API_OPENGL + && ctx->Extensions.ATI_texture_compression_3dc; case GL_ETC1_RGB8_OES: - return ctx->Extensions.OES_compressed_ETC1_RGB8_texture; + return _mesa_is_gles(ctx) + && ctx->Extensions.OES_compressed_ETC1_RGB8_texture; #if FEATURE_ES case GL_PALETTE4_RGB8_OES: case GL_PALETTE4_RGBA8_OES: @@ -962,6 +970,45 @@ _mesa_base_format_has_channel(GLenum base_format, GLenum pname) } +/** + * If format is a generic compressed format, return the corresponding + * non-compressed format. For other formats, return the format as-is. + */ +GLenum +_mesa_generic_compressed_format_to_uncompressed_format(GLenum format) +{ + switch (format) { + case GL_COMPRESSED_RED: + return GL_RED; + case GL_COMPRESSED_RG: + return GL_RG; + case GL_COMPRESSED_RGB: + return GL_RGB; + case GL_COMPRESSED_RGBA: + return GL_RGBA; + case GL_COMPRESSED_ALPHA: + return GL_ALPHA; + case GL_COMPRESSED_LUMINANCE: + return GL_LUMINANCE; + case GL_COMPRESSED_LUMINANCE_ALPHA: + return GL_LUMINANCE_ALPHA; + case GL_COMPRESSED_INTENSITY: + return GL_INTENSITY; + /* sRGB formats */ + case GL_COMPRESSED_SRGB: + return GL_SRGB; + case GL_COMPRESSED_SRGB_ALPHA: + return GL_SRGB_ALPHA; + case GL_COMPRESSED_SLUMINANCE: + return GL_SLUMINANCE; + case GL_COMPRESSED_SLUMINANCE_ALPHA: + return GL_SLUMINANCE_ALPHA; + default: + return format; + } +} + + /** * Do error checking of format/type combinations for glReadPixels, * glDrawPixels and glTex[Sub]Image. Note that depending on the format -- cgit v1.2.3