isl: Add more helpers for determining if a format is an integer format

This commit is contained in:
Jason Ekstrand
2016-03-09 12:25:47 -08:00
parent b0e423cc4f
commit 6f47ed28b4
2 changed files with 24 additions and 0 deletions
+10
View File
@@ -825,9 +825,19 @@ isl_format_get_layout(enum isl_format fmt)
return &isl_format_layouts[fmt];
}
bool
isl_format_has_uint_channel(enum isl_format fmt) ATTRIBUTE_CONST;
bool
isl_format_has_sint_channel(enum isl_format fmt) ATTRIBUTE_CONST;
static inline bool
isl_format_has_int_channel(enum isl_format fmt)
{
return isl_format_has_uint_channel(fmt) ||
isl_format_has_sint_channel(fmt);
}
static inline bool
isl_format_is_compressed(enum isl_format fmt)
{
+14
View File
@@ -25,6 +25,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)
{