Module: Mesa
Branch: main
Commit: a5b272589491e850b092af543f4c8c76e8eebfc5
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5b272589491e850b092af543f4c8c76e8eebfc5

Author: Mike Blumenkrantz <[email protected]>
Date:   Wed Jul 20 16:29:43 2022 -0400

util/format: handle SRGB in util_format_luminance_to_red()

Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>

---

 src/util/format/u_format.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/util/format/u_format.h b/src/util/format/u_format.h
index b2f5e51f9a8..6946c598bda 100644
--- a/src/util/format/u_format.h
+++ b/src/util/format/u_format.h
@@ -1337,6 +1337,12 @@ util_format_luminance_to_red(enum pipe_format format)
    case PIPE_FORMAT_L32A32_SINT:
       return PIPE_FORMAT_R32A32_SINT;
 
+   case PIPE_FORMAT_L8_SRGB:
+      return PIPE_FORMAT_R8_SRGB;
+
+   case PIPE_FORMAT_L8A8_SRGB:
+      return PIPE_FORMAT_R8G8_SRGB;
+
    /* We don't have compressed red-alpha variants for these. */
    case PIPE_FORMAT_LATC2_UNORM:
    case PIPE_FORMAT_LATC2_SNORM:

Reply via email to