diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 4d71fec1c..f8318edd6 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -541,6 +541,12 @@ namespace dxvk { if (attachmentIndex < 0) { this->spillRenderPass(); + + if (m_barriers.isImageDirty( + imageView->image(), + imageView->subresources(), + DxvkAccess::Write)) + m_barriers.recordCommands(m_cmd); // Set up and bind a temporary framebuffer DxvkRenderTargets attachments; @@ -1764,6 +1770,12 @@ namespace dxvk { if (attachmentIndex < 0) { this->spillRenderPass(); + if (m_barriers.isImageDirty( + imageView->image(), + imageView->subresources(), + DxvkAccess::Write)) + m_barriers.recordCommands(m_cmd); + // Set up a temporary framebuffer DxvkRenderTargets attachments; DxvkRenderPassOps ops; @@ -2374,6 +2386,8 @@ namespace dxvk { m_flags.set(DxvkContextFlag::GpRenderPassBound); m_flags.clr(DxvkContextFlag::GpClearRenderTargets); + m_barriers.recordCommands(m_cmd); + this->renderPassBindFramebuffer( m_state.om.framebuffer, m_state.om.renderPassOps, @@ -2433,8 +2447,6 @@ namespace dxvk { info.clearValueCount = clearValueCount; info.pClearValues = clearValues; - m_barriers.recordCommands(m_cmd); - m_cmd->cmdBeginRenderPass(&info, VK_SUBPASS_CONTENTS_INLINE);