From b433e7ba073c66d974dfd8a180ab3970acf18105 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 12 Sep 2011 11:45:43 -0500 Subject: mesa: Add _mesa_cpal_compressed_format_type Signed-off-by: Ian Romanick Reviewed-by: Brian Paul Tested-by: Jin Yang --- src/mesa/main/texpal.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/mesa/main/texpal.c') diff --git a/src/mesa/main/texpal.c b/src/mesa/main/texpal.c index 7608087f43b..0684638f19e 100644 --- a/src/mesa/main/texpal.c +++ b/src/mesa/main/texpal.c @@ -152,6 +152,22 @@ cpal_get_info(GLint level, GLenum internalFormat, return info; } +void +_mesa_cpal_compressed_format_type(GLenum internalFormat, GLenum *format, + GLenum *type) +{ + const struct cpal_format_info *info; + + if (internalFormat < GL_PALETTE4_RGB8_OES + || internalFormat > GL_PALETTE8_RGB5_A1_OES) { + return; + } + + info = &formats[internalFormat - GL_PALETTE4_RGB8_OES]; + *format = info->format; + *type = info->type; +} + /** * Convert a call to glCompressedTexImage2D() where internalFormat is a * compressed palette format into a regular GLubyte/RGBA glTexImage2D() call. -- cgit v1.2.3