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. // If not, we need to create a temporary framebuffer.
int32_t attachmentIndex = -1; 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); attachmentIndex = m_state.om.framebuffer->findAttachment(imageView);
if (attachmentIndex < 0) { 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( void DxvkContext::emitMemoryBarrier(
VkDependencyFlags flags, VkDependencyFlags flags,
VkPipelineStageFlags srcStages, VkPipelineStageFlags srcStages,

View File

@ -1130,7 +1130,7 @@ namespace dxvk {
void resetRenderPassOps( void resetRenderPassOps(
const DxvkRenderTargets& renderTargets, const DxvkRenderTargets& renderTargets,
DxvkRenderPassOps& renderPassOps); DxvkRenderPassOps& renderPassOps);
void startConditionalRendering(); void startConditionalRendering();
void pauseConditionalRendering(); void pauseConditionalRendering();
@ -1196,6 +1196,8 @@ namespace dxvk {
VkPipelineStageFlags stages, VkPipelineStageFlags stages,
VkAccessFlags access); VkAccessFlags access);
DxvkAccessFlags checkFramebufferBarrier();
void emitMemoryBarrier( void emitMemoryBarrier(
VkDependencyFlags flags, VkDependencyFlags flags,
VkPipelineStageFlags srcStages, VkPipelineStageFlags srcStages,