ac/surface: limit RADEON_SURF_NO_TEXTURE to color surfaces
authorChia-I Wu <olvaffe@gmail.com>
Fri, 18 Aug 2023 04:36:23 +0000 (21:36 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 22 Aug 2023 02:36:20 +0000 (02:36 +0000)
commite74c3dbb70706f1a2bcf863b5058295fcd456ae4
treecbf3573eafc7ada0f87aaa98001886d6c60c4e45
parent21778950e100b03e1dacde90cbed60c6f5c91e6b
ac/surface: limit RADEON_SURF_NO_TEXTURE to color surfaces

For z surfaces, flags.texture should be based on
RADEON_SURF_TC_COMPATIBLE_HTILE alone.  Otherwise, addrlib could pick a
_X/_T swizzle mode for a MSAA depth texture, which is said to be broken:

  When _X/_T swizzle mode was used for MSAA depth texture, TC will get zplane
  equation from wrong address within memory range a tile covered and use the
  garbage data for compressed Z reading which finally leads to corruption.

Fixes: de0885cdb89 ("amd/surface: add RADEON_SURF_NO_TEXTURE flag")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24767>
src/amd/common/ac_surface.c
src/amd/common/ac_surface.h