gallium/util: util_format_srgb should not return FORMAT_NONE for sRGB formats
authorMarek Olšák <marek.olsak@amd.com>
Tue, 21 Jan 2014 18:53:45 +0000 (19:53 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 23 Jan 2014 00:47:14 +0000 (01:47 +0100)
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>
src/gallium/auxiliary/util/u_format.h

index 0fbaf4cc1540625b38e25f6fb3baad89280189dd..5f86e2d2c0de44c445e317e6c9e1cc44b91df6a5 100644 (file)
@@ -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;