radv: fix a GPU hang with inherited rendering and HiZ/HiS on GFX1201

With secondary command buffers, inherited rendering can be used but
it's basically impossible to know if the depth/stencil attachment
enabled HiZ/HiS. But it's required to disable WALK_ALIGN8 to avoid
GPU hangs.

This assumes that HiZ/HiS is enabled for inherited rendering as long
as a depth/stencil attachment is used. It's not the most optimal
approach but it's not supposed to hurt either.

This fixes a GPU hang with
dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.contents_secondary_cmdbuffers
and friends.

GFX1200 isn't affected because it doesn't support HiZ/HiS.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33986>
This commit is contained in:
Samuel Pitoiset
2025-03-10 18:29:40 +01:00
committed by Marge Bot
parent c34c7b1f3b
commit d1a2ba57f9
+7
View File
@@ -3625,6 +3625,7 @@ radv_emit_rasterization_samples(struct radv_cmd_buffer *cmd_buffer)
{
struct radv_device *device = radv_cmd_buffer_device(cmd_buffer);
const struct radv_physical_device *pdev = radv_device_physical(device);
const struct radv_instance *instance = radv_physical_device_instance(pdev);
unsigned rasterization_samples = radv_get_rasterization_samples(cmd_buffer);
unsigned ps_iter_samples = radv_get_ps_iter_samples(cmd_buffer);
const struct radv_dynamic_state *d = &cmd_buffer->state.dynamic;
@@ -3639,6 +3640,12 @@ radv_emit_rasterization_samples(struct radv_cmd_buffer *cmd_buffer)
if (render->ds_att.iview) {
const struct radeon_surf *surf = &render->ds_att.iview->image->planes[0].surface;
has_hiz_his = surf->u.gfx9.zs.hiz.offset || surf->u.gfx9.zs.his.offset;
} else if (render->ds_att.format && !(instance->debug_flags & RADV_DEBUG_NO_HIZ)) {
/* For inherited rendering with secondary commands buffers, assume HiZ/HiS is enabled if
* there is a depth/stencil attachment. This shouldn't hurt and it's required to disable
* WALK_ALIGN8 to avoid GPU hangs.
*/
has_hiz_his = true;
}
walk_align8 = !has_hiz_his && !cmd_buffer->state.uses_vrs_attachment;