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:
parent
c7718e5952
commit
014798161c
@ -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,
|
||||
|
@ -1130,7 +1130,7 @@ namespace dxvk {
|
||||
void resetRenderPassOps(
|
||||
const DxvkRenderTargets& renderTargets,
|
||||
DxvkRenderPassOps& renderPassOps);
|
||||
|
||||
|
||||
void startConditionalRendering();
|
||||
void pauseConditionalRendering();
|
||||
|
||||
@ -1196,6 +1196,8 @@ namespace dxvk {
|
||||
VkPipelineStageFlags stages,
|
||||
VkAccessFlags access);
|
||||
|
||||
DxvkAccessFlags checkFramebufferBarrier();
|
||||
|
||||
void emitMemoryBarrier(
|
||||
VkDependencyFlags flags,
|
||||
VkPipelineStageFlags srcStages,
|
||||
|
Loading…
x
Reference in New Issue
Block a user