summaryrefslogtreecommitdiffstats
path: root/src/intel/isl/isl_format.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-03-09 12:25:47 -0800
committerJason Ekstrand <[email protected]>2016-03-10 10:41:52 -0800
commit6f47ed28b4b2a007adc4183c818b608ec2f0be83 (patch)
tree45571ba86d3e7a87b6bfc98a7aa4cea2b1e45b83 /src/intel/isl/isl_format.c
parentb0e423cc4f0b19a266f3ecaf379c0a25bf332e04 (diff)
isl: Add more helpers for determining if a format is an integer format
Diffstat (limited to 'src/intel/isl/isl_format.c')
-rw-r--r--src/intel/isl/isl_format.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/intel/isl/isl_format.c b/src/intel/isl/isl_format.c
index 7842197d861..32bd70186c6 100644
--- a/src/intel/isl/isl_format.c
+++ b/src/intel/isl/isl_format.c
@@ -26,6 +26,20 @@
#include "isl.h"
bool
+isl_format_has_uint_channel(enum isl_format fmt)
+{
+ const struct isl_format_layout *fmtl = isl_format_get_layout(fmt);
+
+ return fmtl->channels.r.type == ISL_UINT ||
+ fmtl->channels.g.type == ISL_UINT ||
+ fmtl->channels.b.type == ISL_UINT ||
+ fmtl->channels.a.type == ISL_UINT ||
+ fmtl->channels.l.type == ISL_UINT ||
+ fmtl->channels.i.type == ISL_UINT ||
+ fmtl->channels.p.type == ISL_UINT;
+}
+
+bool
isl_format_has_sint_channel(enum isl_format fmt)
{
const struct isl_format_layout *fmtl = isl_format_get_layout(fmt);