summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2014-01-21 19:53:45 +0100
committerCarl Worth <cworth@cworth.org>2014-01-25 16:52:17 -0800
commitb1694c9f870f0427addde783c0a4c7091863c2cb (patch)
tree057955940b77b5efad5489729d6e12e11e7e41f5 /src
parente2b6834c87d714248b119e2a79eb2b9c7faba701 (diff)
gallium/util: util_format_srgb should not return FORMAT_NONE for sRGB formats
This fixes a serious regression introduced in 4e549ddb500cf677b6fa16d9ebdfa67cc23da097. Cc: 9.2 10.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit d40532f260c15d56e5fa836147e02c031a999682)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/util/u_format.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h
index 0fbaf4cc154..5f86e2d2c0d 100644
--- a/src/gallium/auxiliary/util/u_format.h
+++ b/src/gallium/auxiliary/util/u_format.h
@@ -872,6 +872,9 @@ util_format_get_component_bits(enum pipe_format format,
static INLINE enum pipe_format
util_format_srgb(enum pipe_format format)
{
+ if (util_format_is_srgb(format))
+ return format;
+
switch (format) {
case PIPE_FORMAT_L8_UNORM:
return PIPE_FORMAT_L8_SRGB;