From 8ed2a241db4d1bdebfc51b8d7b7a0e60ea8bed36 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Fri, 5 Jun 2020 15:29:26 -0700 Subject: [PATCH] i965: Disable color fast-clears for miptree copy During a blorp_copy between two color surfaces, the source and destination formats are re-interpreted to UINT (if possible) to avoid losing bits. If either surface has CCS_E, then extra steps are taken to support fast-cleared blocks with this format re-interpretation. Each clear value is packed in the original format, then unpacked in the new UINT format. This is then placed into the surface state object for some platforms. There are couple problems here: 1. This is only being done for CCS_E, but MCS also supports fast-clears. 2. These steps aren't enough for fast-clears on gen11. On gen11, the clear color isn't part of the surface state object that BLORP creates. Instead it's stored in a separate BO, that the surface state object references. Since that BO doesn't get updated during blorp_copy, the incorrect/unconverted clear color is used for the copy operation. I didn't measure any performance gain from this code, so this patch simply disables the feature. Makes i965 pass the nv_copy_image-simple piglit test on gen11. Reviewed-by: Jason Ekstrand Part-of: --- src/mesa/drivers/dri/i965/brw_blorp.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c index 5cf03c7..2f08d0b 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.c +++ b/src/mesa/drivers/dri/i965/brw_blorp.c @@ -445,8 +445,6 @@ brw_blorp_copy_miptrees(struct brw_context *brw, unsigned dst_x, unsigned dst_y, unsigned src_width, unsigned src_height) { - const struct gen_device_info *devinfo = &brw->screen->devinfo; - DBG("%s from %dx %s mt %p %d %d (%d,%d) %dx%d" "to %dx %s mt %p %d %d (%d,%d)\n", __func__, @@ -471,12 +469,7 @@ brw_blorp_copy_miptrees(struct brw_context *brw, case ISL_AUX_USAGE_MCS: case ISL_AUX_USAGE_CCS_E: src_aux_usage = src_mt->aux_usage; - /* Prior to gen9, fast-clear only supported 0/1 clear colors. Since - * we're going to re-interpret the format as an integer format possibly - * with a different number of components, we can't handle clear colors - * until gen9. - */ - src_clear_supported = devinfo->gen >= 9; + src_clear_supported = false; break; default: src_aux_usage = ISL_AUX_USAGE_NONE; @@ -488,12 +481,7 @@ brw_blorp_copy_miptrees(struct brw_context *brw, case ISL_AUX_USAGE_MCS: case ISL_AUX_USAGE_CCS_E: dst_aux_usage = dst_mt->aux_usage; - /* Prior to gen9, fast-clear only supported 0/1 clear colors. Since - * we're going to re-interpret the format as an integer format possibly - * with a different number of components, we can't handle clear colors - * until gen9. - */ - dst_clear_supported = devinfo->gen >= 9; + dst_clear_supported = false; break; default: dst_aux_usage = ISL_AUX_USAGE_NONE; -- 2.7.4