summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_format.h
diff options
context:
space:
mode:
authorMichal Krol <michal@vmware.com>2009-12-03 10:20:49 +0100
committerMichal Krol <michal@vmware.com>2009-12-03 10:20:49 +0100
commit0bed834be4a174d20b31a6cbcf066774bf749929 (patch)
treecc682542906a7eaf030794976ce4a0c036bd4c14 /src/gallium/auxiliary/util/u_format.h
parentd28740c298968303500a8c43047ded2679e727ac (diff)
Move pf_is_depth_and_stencil() to u_format auxiliary module.
Diffstat (limited to 'src/gallium/auxiliary/util/u_format.h')
-rw-r--r--src/gallium/auxiliary/util/u_format.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h
index cd883d38ca..e57c9e0023 100644
--- a/src/gallium/auxiliary/util/u_format.h
+++ b/src/gallium/auxiliary/util/u_format.h
@@ -141,6 +141,24 @@ util_format_is_depth_or_stencil(enum pipe_format format)
return desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS ? TRUE : FALSE;
}
+static INLINE boolean
+util_format_is_depth_and_stencil(enum pipe_format format)
+{
+ const struct util_format_description *desc = util_format_description(format);
+
+ assert(format);
+ if (!format) {
+ return FALSE;
+ }
+
+ if (desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS) {
+ return FALSE;
+ }
+
+ return (desc->swizzle[0] != UTIL_FORMAT_SWIZZLE_NONE &&
+ desc->swizzle[1] != UTIL_FORMAT_SWIZZLE_NONE) ? TRUE : FALSE;
+}
+
/*
* Format access functions.