summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formats.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2011-01-13 12:12:21 +1000
committerDave Airlie <[email protected]>2011-01-16 12:54:06 +1000
commitedc2dd8e4788e556d445c9f59974ed95b33c2bbc (patch)
tree414f98866a8197661563ec673806ead56de3afc7 /src/mesa/main/formats.c
parentac6334145ec8eef42505cdd727aed7fae0831e12 (diff)
mesa/swrast: implement EXT_texture_sRGB_decode
This implements the extension by choosing a different set of texture fetch functions when the texture parameter changes. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/formats.c')
-rw-r--r--src/mesa/main/formats.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 1bc72726e13..3ccc40b9a79 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -1090,6 +1090,43 @@ _mesa_get_format_color_encoding(gl_format format)
}
}
+gl_format
+_mesa_get_srgb_format_linear(gl_format format)
+{
+ switch (format) {
+ case MESA_FORMAT_SRGB8:
+ format = MESA_FORMAT_RGB888;
+ break;
+ case MESA_FORMAT_SRGBA8:
+ format = MESA_FORMAT_RGBA8888;
+ break;
+ case MESA_FORMAT_SARGB8:
+ format = MESA_FORMAT_ARGB8888;
+ break;
+ case MESA_FORMAT_SL8:
+ format = MESA_FORMAT_L8;
+ break;
+ case MESA_FORMAT_SLA8:
+ format = MESA_FORMAT_AL88;
+ break;
+ case MESA_FORMAT_SRGB_DXT1:
+ format = MESA_FORMAT_RGB_DXT1;
+ break;
+ case MESA_FORMAT_SRGBA_DXT1:
+ format = MESA_FORMAT_RGBA_DXT1;
+ break;
+ case MESA_FORMAT_SRGBA_DXT3:
+ format = MESA_FORMAT_RGBA_DXT3;
+ break;
+ case MESA_FORMAT_SRGBA_DXT5:
+ format = MESA_FORMAT_RGBA_DXT5;
+ break;
+ default:
+ break;
+ }
+ return format;
+}
+
/**
* Return number of bytes needed to store an image of the given size