iris: Avoid fast-clear with incompatible view
authorNanley Chery <nanley.g.chery@intel.com>
Tue, 5 May 2020 22:33:29 +0000 (15:33 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 19 Jun 2020 21:03:31 +0000 (21:03 +0000)
commit48a3f4c44b688176152203366c80011d7020ff63
tree323e3b77d707895b6b927491b7819f2481aa31c1
parentfbbf79377bcad0ed51d00a7d7e981375f8c29d54
iris: Avoid fast-clear with incompatible view

For rendering operations, avoid adding or using fast-cleared blocks if
the render format is incompatible with the clear color interpretation.
Note that the clear color is currently interpreted through the
resource's surface format.

Makes iris pass subtests of the fcc-write-after-clear piglit test:

* UNORM -> SNORM, partial block on gen8+.
* linear -> sRGB, partial block on gen9+.
* UNORM -> SNORM, full block on gen12.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4972>
src/gallium/drivers/iris/iris_clear.c
src/gallium/drivers/iris/iris_resolve.c
src/gallium/drivers/iris/iris_resource.h