mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
radeonsi/gfx11: fix Z corruption for Blender
The corruption only happens with non-TC-compatible HTILE, so always use
TC-compatible HTILE.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11891
Cc: mesa-stable
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31910>
(cherry picked from commit 047532b1e1)
This commit is contained in:
parent
34ed9f05f8
commit
c19d4af9d8
2 changed files with 37 additions and 24 deletions
|
|
@ -1334,7 +1334,7 @@
|
||||||
"description": "radeonsi/gfx11: fix Z corruption for Blender",
|
"description": "radeonsi/gfx11: fix Z corruption for Blender",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 0,
|
"nomination_type": 0,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": null,
|
"because_sha": null,
|
||||||
"notes": null
|
"notes": null
|
||||||
|
|
|
||||||
|
|
@ -1124,18 +1124,23 @@ static struct si_texture *si_texture_create_object(struct pipe_screen *screen,
|
||||||
for (unsigned i = 0; i < ARRAY_SIZE(tex->depth_clear_value); i++)
|
for (unsigned i = 0; i < ARRAY_SIZE(tex->depth_clear_value); i++)
|
||||||
tex->depth_clear_value[i] = 1.0;
|
tex->depth_clear_value[i] = 1.0;
|
||||||
|
|
||||||
/* On GFX8, HTILE uses different tiling depending on the TC_COMPATIBLE_HTILE
|
if (tex->surface.flags & RADEON_SURF_TC_COMPATIBLE_HTILE) {
|
||||||
* setting, so we have to enable it if we enabled it at allocation.
|
/* On GFX8, HTILE uses different tiling depending on the TC_COMPATIBLE_HTILE
|
||||||
*
|
* setting, so we have to enable it if we enabled it at allocation.
|
||||||
* GFX9 and later use the same tiling for both, so TC-compatible HTILE can be
|
*
|
||||||
* enabled on demand.
|
* GFX11 has Z corruption if we don't enable TC-compatible HTILE, see:
|
||||||
*/
|
* https://gitlab.freedesktop.org/mesa/mesa/-/issues/11891
|
||||||
tex->tc_compatible_htile = (sscreen->info.gfx_level == GFX8 &&
|
*
|
||||||
tex->surface.flags & RADEON_SURF_TC_COMPATIBLE_HTILE) ||
|
* GFX9 and later use the same tiling for both, so TC-compatible HTILE can be
|
||||||
/* Mipmapping always starts TC-compatible. */
|
* enabled on demand.
|
||||||
(sscreen->info.gfx_level >= GFX8 &&
|
*/
|
||||||
tex->surface.flags & RADEON_SURF_TC_COMPATIBLE_HTILE &&
|
tex->tc_compatible_htile = sscreen->info.gfx_level == GFX8 ||
|
||||||
tex->buffer.b.b.last_level > 0);
|
sscreen->info.gfx_level >= GFX11 ||
|
||||||
|
/* Mipmapping always starts TC-compatible. */
|
||||||
|
(sscreen->info.gfx_level >= GFX9 &&
|
||||||
|
sscreen->info.gfx_level < GFX11 &&
|
||||||
|
tex->buffer.b.b.last_level > 0);
|
||||||
|
}
|
||||||
|
|
||||||
print_debug_tex(sscreen, tex);
|
print_debug_tex(sscreen, tex);
|
||||||
|
|
||||||
|
|
@ -1380,17 +1385,25 @@ si_texture_create_with_modifier(struct pipe_screen *screen,
|
||||||
|
|
||||||
bool is_flushed_depth = templ->flags & SI_RESOURCE_FLAG_FLUSHED_DEPTH ||
|
bool is_flushed_depth = templ->flags & SI_RESOURCE_FLAG_FLUSHED_DEPTH ||
|
||||||
templ->flags & SI_RESOURCE_FLAG_FORCE_LINEAR;
|
templ->flags & SI_RESOURCE_FLAG_FORCE_LINEAR;
|
||||||
bool tc_compatible_htile =
|
/* We enable TC-compatible HTILE for all Z/S on GFX11+ by default because non-TC-compatible
|
||||||
sscreen->info.has_tc_compatible_htile &&
|
* HTILE causes corruption on Navi31.
|
||||||
/* There are issues with TC-compatible HTILE on Tonga (and
|
*
|
||||||
* Iceland is the same design), and documented bug workarounds
|
* See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11891
|
||||||
* don't help. For example, this fails:
|
*/
|
||||||
* piglit/bin/tex-miplevel-selection 'texture()' 2DShadow -auto
|
bool tc_compatible_htile = is_zs && !is_flushed_depth &&
|
||||||
*/
|
!(sscreen->debug_flags & DBG(NO_HYPERZ)) &&
|
||||||
sscreen->info.family != CHIP_TONGA && sscreen->info.family != CHIP_ICELAND &&
|
sscreen->info.has_tc_compatible_htile;
|
||||||
(templ->flags & PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELY) &&
|
if (sscreen->info.gfx_level < GFX11) {
|
||||||
!(sscreen->debug_flags & DBG(NO_HYPERZ)) && !is_flushed_depth &&
|
tc_compatible_htile &=
|
||||||
is_zs;
|
/* There are issues with TC-compatible HTILE on Tonga (and
|
||||||
|
* Iceland is the same design), and documented bug workarounds
|
||||||
|
* don't help. For example, this fails:
|
||||||
|
* piglit/bin/tex-miplevel-selection 'texture()' 2DShadow -auto
|
||||||
|
*/
|
||||||
|
sscreen->info.family != CHIP_TONGA && sscreen->info.family != CHIP_ICELAND &&
|
||||||
|
templ->flags & PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELY;
|
||||||
|
}
|
||||||
|
|
||||||
enum radeon_surf_mode tile_mode = si_choose_tiling(sscreen, templ, tc_compatible_htile);
|
enum radeon_surf_mode tile_mode = si_choose_tiling(sscreen, templ, tc_compatible_htile);
|
||||||
|
|
||||||
/* This allocates textures with multiple planes like NV12 in 1 buffer. */
|
/* This allocates textures with multiple planes like NV12 in 1 buffer. */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue