mesa: document sRGBDecode field
[mesa.git] / src / mesa / main / texcompress.c
index a4f1926ab3789d11351f242fd60a88de3688ab82..7a0b522a2d8ea0873c40187e6961e7cb0628887d 100644 (file)
 #include "glheader.h"
 #include "imports.h"
 #include "colormac.h"
-#include "context.h"
 #include "formats.h"
-#include "image.h"
-#include "mipmap.h"
+#include "mfeatures.h"
+#include "mtypes.h"
 #include "texcompress.h"
-#include "texstore.h"
 
 
 /**
@@ -54,7 +52,7 @@
  * \return number of formats.
  */
 GLuint
-_mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all)
+_mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats, GLboolean all)
 {
    GLuint n = 0;
    if (ctx->Extensions.TDFX_texture_compression_FXT1) {
@@ -110,6 +108,24 @@ _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all)
    }
 #endif /* FEATURE_EXT_texture_sRGB */
    return n;
+
+#if FEATURE_ES1 || FEATURE_ES2
+   if (formats) {
+      formats[n++] = GL_PALETTE4_RGB8_OES;
+      formats[n++] = GL_PALETTE4_RGBA8_OES;
+      formats[n++] = GL_PALETTE4_R5_G6_B5_OES;
+      formats[n++] = GL_PALETTE4_RGBA4_OES;
+      formats[n++] = GL_PALETTE4_RGB5_A1_OES;
+      formats[n++] = GL_PALETTE8_RGB8_OES;
+      formats[n++] = GL_PALETTE8_RGBA8_OES;
+      formats[n++] = GL_PALETTE8_R5_G6_B5_OES;
+      formats[n++] = GL_PALETTE8_RGBA4_OES;
+      formats[n++] = GL_PALETTE8_RGB5_A1_OES;
+   }
+   else {
+      n += 10;
+   }
+#endif
 }
 
 
@@ -164,7 +180,7 @@ _mesa_glenum_to_compressed_format(GLenum format)
  * internal format unchanged.
  */
 GLenum
-_mesa_compressed_format_to_glenum(GLcontext *ctx, GLuint mesaFormat)
+_mesa_compressed_format_to_glenum(struct gl_context *ctx, GLuint mesaFormat)
 {
    switch (mesaFormat) {
 #if FEATURE_texture_fxt1