enum isl_format format);
bool isl_format_supports_vertex_fetch(const struct gen_device_info *devinfo,
enum isl_format format);
+bool isl_format_supports_ccs_d(const struct gen_device_info *devinfo,
+ enum isl_format format);
bool isl_format_supports_ccs_e(const struct gen_device_info *devinfo,
enum isl_format format);
bool isl_format_supports_multisampling(const struct gen_device_info *devinfo,
return format_gen(devinfo) >= format_info[format].input_vb;
}
+/**
+ * Returns true if the given format can support single-sample fast clears.
+ * This function only checks the format. In order to determine if a surface
+ * supports CCS_E, several other factors need to be considered such as tiling
+ * and sample count. See isl_surf_get_ccs_surf for details.
+ */
+bool
+isl_format_supports_ccs_d(const struct gen_device_info *devinfo,
+ enum isl_format format)
+{
+ /* Fast clears were first added on Ivy Bridge */
+ if (devinfo->gen < 7)
+ return false;
+
+ if (!isl_format_supports_rendering(devinfo, format))
+ return false;
+
+ const struct isl_format_layout *fmtl = isl_format_get_layout(format);
+
+ return fmtl->bpb == 32 || fmtl->bpb == 64 || fmtl->bpb == 128;
+}
+
bool
isl_format_supports_ccs_e(const struct gen_device_info *devinfo,
enum isl_format format)