1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[dxvk] Eliminate back-to-back clears when no render pass is active

Trine 4 hits this with a multisampled depth buffer multiple times
per frame. Previously, we'd only eliminate redudant clears if the
render target to clear was active in the current render pass.
This commit is contained in:
Philip Rebohle 2020-11-21 03:03:15 +01:00
parent 61a07fc9b9
commit d256175981
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -1819,6 +1819,21 @@ namespace dxvk {
const Rc<DxvkImageView>& imageView,
VkImageAspectFlags clearAspects,
VkClearValue clearValue) {
for (auto& entry : m_deferredClears) {
if (entry.imageView == imageView) {
entry.clearAspects |= clearAspects;
if (clearAspects & VK_IMAGE_ASPECT_COLOR_BIT)
entry.clearValue.color = clearValue.color;
if (clearAspects & VK_IMAGE_ASPECT_DEPTH_BIT)
entry.clearValue.depthStencil.depth = clearValue.depthStencil.depth;
if (clearAspects & VK_IMAGE_ASPECT_STENCIL_BIT)
entry.clearValue.depthStencil.stencil = clearValue.depthStencil.stencil;
return;
}
}
m_deferredClears.push_back({ imageView, clearAspects, clearValue });
}