radeonsi: add gfx11 workaround for upgraded_depth

For unknown reasons, this is needed to avoid breaking
a bunch of tests:

   .*tex-miplevel-selection.*
   KHR-GL46.direct_state_access.framebuffers_texture_attachment,Fail
   KHR-GL46.direct_state_access.framebuffers_texture_layer_attachment,Fail
   .*.core.texture_cube_map_array.sampling

These failures were previously hidden by extra flushes in the
blitter that were removed in 969ed851.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29612>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2024-06-17 13:18:30 +02:00
committed by Marge Bot
parent abd048124a
commit c97591b862

View File

@@ -2637,6 +2637,23 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
* Note that lower mipmap levels aren't compressed.
*/
si_make_DB_shader_coherent(sctx, 1, false, sctx->framebuffer.DB_has_shader_readable_metadata);
} else if (old_has_zsbuf &&
sctx->gfx_level == GFX11 && sctx->screen->info.family == CHIP_NAVI33) {
struct si_surface *old_zsurf = (struct si_surface *)sctx->framebuffer.state.zsbuf;
struct si_texture *old_ztex = (struct si_texture *)old_zsurf->base.texture;
if (old_ztex->upgraded_depth) {
/* TODO: some failures related to hyperz appeared after 969ed851 on nv33:
* - piglit tex-miplevel-selection
* - KHR-GL46.direct_state_access.framebuffers_texture_attachment
* - GTF-GL46.gtf30.GL3Tests.blend_minmax.blend_minmax_draw
* - KHR-GL46.direct_state_access.framebuffers_texture_layer_attachment
*
* This seems to fix them:
*/
sctx->flags |= SI_CONTEXT_FLUSH_AND_INV_DB | SI_CONTEXT_INV_L2;
si_mark_atom_dirty(sctx, &sctx->atoms.s.cache_flush);
}
} else if (sctx->gfx_level == GFX9) {
/* It appears that DB metadata "leaks" in a sequence of:
* - depth clear