From 401eb04e4dfb179291befb19d74e2e3148c4e268 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 8 Nov 2013 11:09:17 +0100 Subject: libxtrans libxcb xcb-proto mesa git update 8 nov 2013 libxcb commit e8663a935890ff366f49e356211049dfd0d9756a libxcb/xcb-proto commit 29beba6bf02bda86a5b163ace63e1d0a4d3eee5b libxtrans commit 0153d1670e4a1883e1bb6dd971435d6268eac5ba mesa commit 035cce83f7b3d9a037c9e7cc17a212d6cf7e927f --- mesalib/src/gallium/auxiliary/util/u_format.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'mesalib/src/gallium/auxiliary/util/u_format.h') diff --git a/mesalib/src/gallium/auxiliary/util/u_format.h b/mesalib/src/gallium/auxiliary/util/u_format.h index 369c3994a..0fbaf4cc1 100644 --- a/mesalib/src/gallium/auxiliary/util/u_format.h +++ b/mesalib/src/gallium/auxiliary/util/u_format.h @@ -545,6 +545,22 @@ util_format_is_depth_and_stencil(enum pipe_format format) } +/** + * Calculates the depth format type based upon the incoming format description. + */ +static INLINE unsigned +util_get_depth_format_type(const struct util_format_description *desc) +{ + unsigned depth_channel = desc->swizzle[0]; + if (desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS && + depth_channel != UTIL_FORMAT_SWIZZLE_NONE) { + return desc->channel[depth_channel].type; + } else { + return UTIL_FORMAT_TYPE_VOID; + } +} + + /** * Calculates the MRD for the depth format. MRD is used in depth bias * for UNORM and unbound depth buffers. When the depth buffer is floating @@ -552,7 +568,7 @@ util_format_is_depth_and_stencil(enum pipe_format format) * default MRD will be 1.0 / ((1 << 24) - 1). */ double -util_get_depth_format_mrd(enum pipe_format format); +util_get_depth_format_mrd(const struct util_format_description *desc); /** -- cgit v1.2.3