summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_format.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h
index bd4e51d279f..1718fb5e240 100644
--- a/src/gallium/auxiliary/util/u_format.h
+++ b/src/gallium/auxiliary/util/u_format.h
@@ -549,6 +549,19 @@ util_format_colormask(const struct util_format_description *desc)
}
+/**
+ * Checks if color mask covers every channel for the specified format
+ *
+ * @param desc a format description to check colormask with
+ * @param colormask a bit mask for channels, matches format of PIPE_MASK_RGBA
+ */
+static INLINE boolean
+util_format_colormask_full(const struct util_format_description *desc, unsigned colormask)
+{
+ return (~colormask & util_format_colormask(desc)) == 0;
+}
+
+
boolean
util_format_is_float(enum pipe_format format);