iris: Fix aux usage tracking in prepare_render
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 26 Jul 2023 18:11:34 +0000 (14:11 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 10 Aug 2023 16:21:28 +0000 (16:21 +0000)
commit3acdb29332e195a6a6968bddb770d4fd51f511bd
tree98a759c5420747afd4c9312e7d38fa1ad48f5215
parentabc0b3a0dd1d3a71b7da2f90e5c630da11de3a9e
iris: Fix aux usage tracking in prepare_render

When a resource goes from being accessed with one aux usage to another,
iris_resource_prepare_access will flush the appropriate caches to
prevent rendering/sampling corruption. So, we must be careful to call
the prepare access function with the aux usage that will match the next
memory access of the resource.

iris_resource_prepare_render fails to do this because it sometimes calls
the prepare access function with the resource's aux usage after calling
that same function with the aux usage that will be used in the next
memory access.

Fix this by reversing the order of the prepare access function calls.

Fixes: 046bba0be05 ("iris: Handle clear color compatibility in prepare_render")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24446>
src/gallium/drivers/iris/iris_resolve.c