From 8fc606b0f4e1d29580c9745eed1318838999803d Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Mon, 6 Mar 2017 14:54:28 +0000 Subject: [PATCH] radv: Emit pending flushes before executing a secondary command buffer If we have any pending flushes on the primary command buffer, these must be performed before executing the secondary buffer. This fixes potential corruption when the contents of a subpass which clears any of its render targets are given in a secondary buffer: the flushes after a fast clear would not have been performed until the vkCmdEndRenderPass call. Signed-off-by: Alex Smith Reviewed-by: Bas Nieuwenhuizen Cc: 13.0 17.0 (cherry picked from commit 290d7e892dfa6d04767142f4f6d7ec689933a105) --- src/amd/vulkan/radv_cmd_buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 8611dc86e99..65553a674a5 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -1653,6 +1653,9 @@ void radv_CmdExecuteCommands( { RADV_FROM_HANDLE(radv_cmd_buffer, primary, commandBuffer); + /* Emit pending flushes on primary prior to executing secondary */ + si_emit_cache_flush(primary); + for (uint32_t i = 0; i < commandBufferCount; i++) { RADV_FROM_HANDLE(radv_cmd_buffer, secondary, pCmdBuffers[i]);