util: linearized sRGB values don't fit into 8bits
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 17 Sep 2010 10:13:37 +0000 (11:13 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 17 Sep 2010 18:18:42 +0000 (19:18 +0100)
Fixes glean texture_srgb test.

src/gallium/auxiliary/util/u_format.c

index a4ee91b0cf9d3c5b57db87c982a9ae6c7ed3e3d5..4896faa12bf95cce66dd4b21229c5733e9509995 100644 (file)
@@ -173,6 +173,14 @@ util_format_fits_8unorm(const struct util_format_description *format_desc)
 {
    unsigned chan;
 
+   /*
+    * After linearized sRGB values require more than 8bits.
+    */
+
+   if (format_desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) {
+      return FALSE;
+   }
+
    switch (format_desc->layout) {
 
    case UTIL_FORMAT_LAYOUT_S3TC: