diff --git a/.pick_status.json b/.pick_status.json index d3dfe9dc6fc..168cedb1586 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1334,7 +1334,7 @@ "description": "radeonsi/gfx11: fix Z corruption for Blender", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 54b2c389482..e73ae2d3f55 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -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++) tex->depth_clear_value[i] = 1.0; - /* 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. - */ - tex->tc_compatible_htile = (sscreen->info.gfx_level == GFX8 && - tex->surface.flags & RADEON_SURF_TC_COMPATIBLE_HTILE) || - /* Mipmapping always starts TC-compatible. */ - (sscreen->info.gfx_level >= GFX8 && - tex->surface.flags & RADEON_SURF_TC_COMPATIBLE_HTILE && - tex->buffer.b.b.last_level > 0); + if (tex->surface.flags & RADEON_SURF_TC_COMPATIBLE_HTILE) { + /* 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. + * + * GFX11 has Z corruption if we don't enable TC-compatible HTILE, see: + * https://gitlab.freedesktop.org/mesa/mesa/-/issues/11891 + * + * GFX9 and later use the same tiling for both, so TC-compatible HTILE can be + * enabled on demand. + */ + tex->tc_compatible_htile = sscreen->info.gfx_level == GFX8 || + 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); @@ -1380,17 +1385,25 @@ si_texture_create_with_modifier(struct pipe_screen *screen, bool is_flushed_depth = templ->flags & SI_RESOURCE_FLAG_FLUSHED_DEPTH || templ->flags & SI_RESOURCE_FLAG_FORCE_LINEAR; - bool tc_compatible_htile = - sscreen->info.has_tc_compatible_htile && - /* 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) && - !(sscreen->debug_flags & DBG(NO_HYPERZ)) && !is_flushed_depth && - is_zs; + /* We enable TC-compatible HTILE for all Z/S on GFX11+ by default because non-TC-compatible + * HTILE causes corruption on Navi31. + * + * See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11891 + */ + bool tc_compatible_htile = is_zs && !is_flushed_depth && + !(sscreen->debug_flags & DBG(NO_HYPERZ)) && + sscreen->info.has_tc_compatible_htile; + if (sscreen->info.gfx_level < GFX11) { + tc_compatible_htile &= + /* 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); /* This allocates textures with multiple planes like NV12 in 1 buffer. */