From e86f381ea1b690be20f18b01d44461269c77a217 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Thu, 19 Mar 2020 10:11:28 +0100 Subject: [PATCH] v3dv: drop incorrect assertion on number of clear values at render pass begin There can be more clear values than attachments, we should just ignore them in that case. Fixes some tests in: dEQP-VK.fragment_operations.* Part-of: --- src/broadcom/vulkan/v3dv_cmd_buffer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/broadcom/vulkan/v3dv_cmd_buffer.c b/src/broadcom/vulkan/v3dv_cmd_buffer.c index 3a9d29e5d9e..ac75c2b4fa9 100644 --- a/src/broadcom/vulkan/v3dv_cmd_buffer.c +++ b/src/broadcom/vulkan/v3dv_cmd_buffer.c @@ -795,8 +795,13 @@ cmd_buffer_state_set_clear_values(struct v3dv_cmd_buffer *cmd_buffer, { struct v3dv_cmd_buffer_state *state = &cmd_buffer->state; const struct v3dv_render_pass *pass = state->pass; - assert(count <= pass->attachment_count); + /* There could be less clear values than attachments in the render pass, in + * which case we only want to process as many as we have, or there could be + * more, in which case we want to ignore those for which we don't have a + * corresponding attachment. + */ + count = MIN2(count, pass->attachment_count); for (uint32_t i = 0; i < count; i++) { const struct v3dv_render_pass_attachment *attachment = &pass->attachments[i];