util/format: Add a util_format_get_depth_bits() helper

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39324>
This commit is contained in:
Faith Ekstrand 2026-02-24 09:52:23 -05:00 committed by Marge Bot
parent 53474cfef0
commit 397297e7de

View file

@ -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.