iris: Don't fast clear with the view format

Fast clear with the resource format instead. This is safe to do because
can_fast_clear_color ensures that the clear color generates the same
pixel with either the view format or the resource format.

On SKL, this prevents us from using an invalid surface state. This platform
doesn't support CCS_E with sRGB formats, but prior to this patch we allowed
fast-clearing with this combination. Piglit's fcc-write-after-clear test
can trigger this.

Fixes: 230952c210 ("iris: Don't support sRGB + Y_TILED_CCS on gen9")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
This commit is contained in:
Nanley Chery 2021-12-27 10:15:19 -05:00 committed by Marge Bot
parent 68c1b50e48
commit 6778b3a379

View file

@ -280,7 +280,8 @@ fast_clear_color(struct iris_context *ice,
iris_blorp_surf_for_resource(&batch->screen->isl_dev, &surf,
p_res, res->aux.usage, level, true);
blorp_fast_clear(&blorp_batch, &surf, format, ISL_SWIZZLE_IDENTITY,
blorp_fast_clear(&blorp_batch, &surf, res->surf.format,
ISL_SWIZZLE_IDENTITY,
level, box->z, box->depth,
box->x, box->y, box->x + box->width,
box->y + box->height);