summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Smith <[email protected]>2017-03-06 14:54:28 +0000
committerBas Nieuwenhuizen <[email protected]>2017-03-06 19:46:14 +0100
commit290d7e892dfa6d04767142f4f6d7ec689933a105 (patch)
tree274dead0d2b5df2d816faea7dc9177a1805495c2
parent052c81faa1147ab758dc4430e4483c7d9fc5fe25 (diff)
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 <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: 13.0 17.0 <[email protected]>
-rw-r--r--src/amd/vulkan/radv_cmd_buffer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 3ff52502ffe..d99288a6722 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -2110,6 +2110,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]);