#include <assert.h>
#include "isl.h"
-#include "common/gen_device_info.h"
+#include "dev/gen_device_info.h"
struct surface_format_info {
bool exists;
*/
if (fmtl->txc == ISL_TXC_ASTC)
return format < ISL_FORMAT_ASTC_HDR_2D_4X4_FLT16;
- } else if (devinfo->is_broxton) {
+ } else if (gen_device_info_is_9lp(devinfo)) {
const struct isl_format_layout *fmtl = isl_format_get_layout(format);
/* Support for ASTC HDR exists on Broxton even though big-core
* GPUs didn't get it until Cannonlake.
*/
if (fmtl->txc == ISL_TXC_ASTC)
return format < ISL_FORMAT_ASTC_HDR_2D_4X4_FLT16;
- } else if (devinfo->is_broxton) {
+ } else if (gen_device_info_is_9lp(devinfo)) {
const struct isl_format_layout *fmtl = isl_format_get_layout(format);
/* Support for ASTC HDR exists on Broxton even though big-core
* GPUs didn't get it until Cannonlake.
if (!format_info[format].exists)
return false;
+ /* For simplicity, only report that a format supports CCS_E if blorp can
+ * perform bit-for-bit copies with an image of that format while compressed.
+ * This allows ISL users to avoid having to resolve the image before
+ * performing such a copy. We may want to change this behavior in the
+ * future.
+ *
+ * R11G11B10_FLOAT has no equivalent UINT format. Given how blorp_copy
+ * currently works, bit-for-bit copy operations are not possible without an
+ * intermediate resolve.
+ */
+ if (format == ISL_FORMAT_R11G11B10_FLOAT)
+ return false;
+
+ /* blorp_copy currently doesn't support formats with different bit-widths
+ * per-channel. Until that support is added, report that these formats don't
+ * support CCS_E. FIXME: Add support for these formats.
+ */
+ if (format == ISL_FORMAT_B10G10R10A2_UNORM ||
+ format == ISL_FORMAT_B10G10R10A2_UNORM_SRGB ||
+ format == ISL_FORMAT_R10G10B10A2_UNORM ||
+ format == ISL_FORMAT_R10G10B10A2_UINT) {
+ return false;
+ }
+
return format_gen(devinfo) >= format_info[format].ccs_e;
}
* - any compressed texture format (BC*)
* - any YCRCB* format
*
- * The restriction on the format's size is removed on Broadwell. Also,
- * there is an exception for HiZ which we treat as a compressed format and
- * is allowed to be multisampled on Broadwell and earlier.
+ * The restriction on the format's size is removed on Broadwell. Moreover,
+ * empirically it looks that even IvyBridge can handle multisampled surfaces
+ * with format sizes all the way to 128-bits (RGBA32F, RGBA32I, RGBA32UI).
+ *
+ * Also, there is an exception for HiZ which we treat as a compressed
+ * format and is allowed to be multisampled on Broadwell and earlier.
*/
if (format == ISL_FORMAT_HIZ) {
/* On SKL+, HiZ is always single-sampled even when the primary surface
* is multisampled. See also isl_surf_get_hiz_surf().
*/
return devinfo->gen <= 8;
- } else if (devinfo->gen < 8 && isl_format_get_layout(format)->bpb > 64) {
+ } else if (devinfo->gen < 7 && isl_format_get_layout(format)->bpb > 64) {
return false;
} else if (isl_format_is_compressed(format)) {
return false;
fmtl1->channels.a.bits == fmtl2->channels.a.bits;
}
-static inline bool
+static bool
isl_format_has_channel_type(enum isl_format fmt, enum isl_base_type type)
{
const struct isl_format_layout *fmtl = isl_format_get_layout(fmt);