From 4879f309a6d366bb8bf753e165d7fceff4969419 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Mon, 5 Dec 2022 00:51:19 +0100 Subject: [PATCH] radv: Reserve space in framebuffer emission. In the execute secondary scenario nothing else does it for us. Fixes: 203f60ebf2f ("radv: emit framebuffer state from primary if secondary doesn't inherit it") Part-of: --- src/amd/vulkan/radv_cmd_buffer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index f45b4db..69ef521 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -3402,6 +3402,9 @@ radv_emit_framebuffer_state(struct radv_cmd_buffer *cmd_buffer) ? S_028C70_FORMAT_GFX11(V_028C70_COLOR_INVALID) : S_028C70_FORMAT_GFX6(V_028C70_COLOR_INVALID); + ASSERTED unsigned cdw_max = + radeon_check_space(cmd_buffer->device->ws, cmd_buffer->cs, 48 + MAX_RTS * 70); + for (i = 0; i < render->color_att_count; ++i) { struct radv_image_view *iview = render->color_att[i].iview; if (!iview) { @@ -3557,6 +3560,8 @@ radv_emit_framebuffer_state(struct radv_cmd_buffer *cmd_buffer) } } + assert(cmd_buffer->cs->cdw <= cdw_max); + cmd_buffer->state.dirty &= ~RADV_CMD_DIRTY_FRAMEBUFFER; } -- 2.7.4