From e4b17a2e1a9f1b8536bed6faca9d8e62483fab35 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Wed, 13 Jan 2016 18:37:27 -0800 Subject: [PATCH] anv/meta: Implement vkCmdClearAttachments --- src/vulkan/anv_meta_clear.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/vulkan/anv_meta_clear.c b/src/vulkan/anv_meta_clear.c index 722751cda80..b7f2f18b994 100644 --- a/src/vulkan/anv_meta_clear.c +++ b/src/vulkan/anv_meta_clear.c @@ -933,5 +933,19 @@ void anv_CmdClearAttachments( uint32_t rectCount, const VkClearRect* pRects) { - stub(); + ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, commandBuffer); + struct anv_meta_saved_state saved_state; + + meta_clear_begin(&saved_state, cmd_buffer); + + /* FINISHME: We can do better than this dumb loop. It thrashes too much + * state. + */ + for (uint32_t a = 0; a < attachmentCount; ++a) { + for (uint32_t r = 0; r < rectCount; ++r) { + emit_clear(cmd_buffer, &pAttachments[a], &pRects[r]); + } + } + + meta_clear_end(&saved_state, cmd_buffer); } -- 2.30.2