summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorGrigori Goronzy <[email protected]>2014-06-04 18:54:36 +0200
committerChristian König <[email protected]>2014-06-18 13:58:19 +0200
commitf5dafc156a28f6550b6a0bfd5153b40448402f0c (patch)
tree36adec4f3ad2da239d5323362588a2d1cd03f441 /src/gallium/auxiliary
parent700100d94bcd46b6088c27cc77e12f86f9fda122 (diff)
util/u_format: move utility function from r600g
We need this for radeonsi, and it might be useful for other drivers, too.
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/util/u_format.c11
-rw-r--r--src/gallium/auxiliary/util/u_format.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_format.c b/src/gallium/auxiliary/util/u_format.c
index 056f82f72e5..a53ed6f297b 100644
--- a/src/gallium/auxiliary/util/u_format.c
+++ b/src/gallium/auxiliary/util/u_format.c
@@ -187,6 +187,17 @@ util_format_is_intensity(enum pipe_format format)
return FALSE;
}
+boolean
+util_format_is_subsampled_422(enum pipe_format format)
+{
+ const struct util_format_description *desc =
+ util_format_description(format);
+
+ return desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED &&
+ desc->block.width == 2 &&
+ desc->block.height == 1 &&
+ desc->block.bits == 32;
+}
boolean
util_format_is_supported(enum pipe_format format, unsigned bind)
diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h
index 1dd5d52f1e6..2e2bf0240dd 100644
--- a/src/gallium/auxiliary/util/u_format.h
+++ b/src/gallium/auxiliary/util/u_format.h
@@ -664,6 +664,9 @@ boolean
util_format_is_intensity(enum pipe_format format);
boolean
+util_format_is_subsampled_422(enum pipe_format format);
+
+boolean
util_format_is_pure_integer(enum pipe_format format);
boolean