mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-27 22: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.
|
// 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,
|
||||||
|
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user