return devinfo->gen * 10 + (devinfo->is_g4x || devinfo->is_haswell) * 5;
}
+static bool
+format_info_exists(enum isl_format format)
+{
+ assert(format != ISL_FORMAT_UNSUPPORTED);
+ assert(format < ISL_NUM_FORMATS);
+ return format < ARRAY_SIZE(format_info) && format_info[format].exists;
+}
+
bool
isl_format_supports_rendering(const struct gen_device_info *devinfo,
enum isl_format format)
{
- if (!format_info[format].exists)
+ if (!format_info_exists(format))
return false;
return format_gen(devinfo) >= format_info[format].render_target;
isl_format_supports_alpha_blending(const struct gen_device_info *devinfo,
enum isl_format format)
{
- if (!format_info[format].exists)
+ if (!format_info_exists(format))
return false;
return format_gen(devinfo) >= format_info[format].alpha_blend;
isl_format_supports_sampling(const struct gen_device_info *devinfo,
enum isl_format format)
{
- if (!format_info[format].exists)
+ if (!format_info_exists(format))
return false;
if (devinfo->is_baytrail) {
isl_format_supports_filtering(const struct gen_device_info *devinfo,
enum isl_format format)
{
- if (!format_info[format].exists)
+ if (!format_info_exists(format))
return false;
if (devinfo->is_baytrail) {
isl_format_supports_vertex_fetch(const struct gen_device_info *devinfo,
enum isl_format format)
{
- if (!format_info[format].exists)
+ if (!format_info_exists(format))
return false;
/* For vertex fetch, Bay Trail supports the same set of formats as Haswell
isl_format_supports_typed_writes(const struct gen_device_info *devinfo,
enum isl_format format)
{
- if (!format_info[format].exists)
+ if (!format_info_exists(format))
return false;
return format_gen(devinfo) >= format_info[format].typed_write;
isl_format_supports_typed_reads(const struct gen_device_info *devinfo,
enum isl_format format)
{
- if (!format_info[format].exists)
+ if (!format_info_exists(format))
return false;
return format_gen(devinfo) >= format_info[format].typed_read;
isl_format_supports_ccs_e(const struct gen_device_info *devinfo,
enum isl_format format)
{
- if (!format_info[format].exists)
+ if (!format_info_exists(format))
return false;
/* For simplicity, only report that a format supports CCS_E if blorp can