1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-27 13:54:16 +01:00

[dxvk] Avoid some unnecessary barriers around render target clears

This commit is contained in:
Philip Rebohle 2019-11-18 19:36:19 +01:00
parent c7718e5952
commit 014798161c
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 18 additions and 2 deletions

View File

@ -613,7 +613,7 @@ namespace dxvk {
// If not, we need to create a temporary framebuffer.
int32_t attachmentIndex = -1;
if (m_state.om.framebuffer->isFullSize(imageView))
if (m_state.om.framebuffer->isFullSize(imageView) && this->checkFramebufferBarrier().isClear())
attachmentIndex = m_state.om.framebuffer->findAttachment(imageView);
if (attachmentIndex < 0) {
@ -4727,6 +4727,20 @@ namespace dxvk {
}
DxvkAccessFlags DxvkContext::checkFramebufferBarrier() {
DxvkAccessFlags access = 0;
for (uint32_t i = 0; i < m_state.om.framebuffer->numAttachments(); i++) {
const auto& attachment = m_state.om.framebuffer->getAttachment(i);
access.set(m_execBarriers.getImageAccess(
attachment.view->image(),
attachment.view->subresources()));
}
return access;
}
void DxvkContext::emitMemoryBarrier(
VkDependencyFlags flags,
VkPipelineStageFlags srcStages,

View File

@ -1196,6 +1196,8 @@ namespace dxvk {
VkPipelineStageFlags stages,
VkAccessFlags access);
DxvkAccessFlags checkFramebufferBarrier();
void emitMemoryBarrier(
VkDependencyFlags flags,
VkPipelineStageFlags srcStages,