From: Chad Versace Date: Thu, 14 Jan 2016 02:37:27 +0000 (-0800) Subject: anv/meta: Implement vkCmdClearAttachments X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e4b17a2e1a9f1b8536bed6faca9d8e62483fab35;p=mesa.git anv/meta: Implement vkCmdClearAttachments --- 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); }