From 397297e7de2c72f50512bd0ff7406bba79869da5 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 24 Feb 2026 09:52:23 -0500 Subject: [PATCH] util/format: Add a util_format_get_depth_bits() helper Reviewed-by: Christoph Pillmayer Part-of: --- 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 d56116e71ab..3dc5d3191e3 100644 --- a/src/util/format/u_format.h +++ b/src/util/format/u_format.h @@ -1086,6 +1086,12 @@ util_format_get_component_shift(enum pipe_format format, } } +static inline unsigned +util_format_get_depth_bits(enum pipe_format format) +{ + return util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_ZS, 0); +} + /** * Given a linear RGB colorspace format, return the corresponding SRGB * format, or PIPE_FORMAT_NONE if none.