isl/format: Add more isl_format_has_type_channel functions

Reviewed-by: Chad Versace <chad.versace@intel.com>
This commit is contained in:
Jason Ekstrand 2016-04-15 21:31:47 -07:00
parent a4c04dd410
commit 3415cf5f2f
2 changed files with 43 additions and 4 deletions

View file

@ -826,11 +826,26 @@ 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_unorm_channel(enum isl_format fmt) ATTRIBUTE_CONST;
bool isl_format_has_snorm_channel(enum isl_format fmt) ATTRIBUTE_CONST;
bool isl_format_has_ufloat_channel(enum isl_format fmt) ATTRIBUTE_CONST;
bool isl_format_has_sfloat_channel(enum isl_format fmt) ATTRIBUTE_CONST;
bool isl_format_has_uint_channel(enum isl_format fmt) ATTRIBUTE_CONST;
bool isl_format_has_sint_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_normalized_channel(enum isl_format fmt)
{
return isl_format_has_unorm_channel(fmt) ||
isl_format_has_snorm_channel(fmt);
}
static inline bool
isl_format_has_float_channel(enum isl_format fmt)
{
return isl_format_has_ufloat_channel(fmt) ||
isl_format_has_sfloat_channel(fmt);
}
static inline bool
isl_format_has_int_channel(enum isl_format fmt)

View file

@ -39,6 +39,30 @@ isl_format_has_channel_type(enum isl_format fmt, enum isl_base_type type)
fmtl->channels.p.type == type;
}
bool
isl_format_has_unorm_channel(enum isl_format fmt)
{
return isl_format_has_channel_type(fmt, ISL_UNORM);
}
bool
isl_format_has_snorm_channel(enum isl_format fmt)
{
return isl_format_has_channel_type(fmt, ISL_SNORM);
}
bool
isl_format_has_ufloat_channel(enum isl_format fmt)
{
return isl_format_has_channel_type(fmt, ISL_UFLOAT);
}
bool
isl_format_has_sfloat_channel(enum isl_format fmt)
{
return isl_format_has_channel_type(fmt, ISL_SFLOAT);
}
bool
isl_format_has_uint_channel(enum isl_format fmt)
{