From 903a66abaf91d143a12d72348c0be463b73506e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 17 Sep 2010 11:13:37 +0100 Subject: [PATCH] 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 a4ee91b..4896faa 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: -- 2.7.4