From 903a66abaf91d143a12d72348c0be463b73506e6 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 17 Sep 2010 11:13:37 +0100 Subject: util: linearized sRGB values don't fit into 8bits Fixes glean texture_srgb test. --- src/gallium/auxiliary/util/u_format.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/auxiliary/util/u_format.c b/src/gallium/auxiliary/util/u_format.c index a4ee91b0cf..4896faa12b 100644 --- a/src/gallium/auxiliary/util/u_format.c +++ b/src/gallium/auxiliary/util/u_format.c @@ -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: -- cgit v1.2.3