[dxvk] Store new image view when deferring clear/discard with matching subresources

Otherwise, if the view used for the second clear has a different format than
the first one, we'll end up clearing to the wrong colur. Assumes that images
with more than one aspect never have views with mismatching formats.

Also potentially improves logic around render pass clears depending on usage
patterns.
This commit is contained in:
Philip Rebohle 2021-03-06 02:37:02 +01:00
parent b579b03047
commit 8a4beefd3a
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
1 changed files with 2 additions and 0 deletions

View File

@ -1857,6 +1857,7 @@ namespace dxvk {
VkClearValue clearValue) {
for (auto& entry : m_deferredClears) {
if (entry.imageView->checkSubresourceMatch(imageView)) {
entry.imageView = imageView;
entry.discardAspects &= ~clearAspects;
entry.clearAspects |= clearAspects;
@ -1883,6 +1884,7 @@ namespace dxvk {
VkImageAspectFlags discardAspects) {
for (auto& entry : m_deferredClears) {
if (entry.imageView->checkSubresourceMatch(imageView)) {
entry.imageView = imageView;
entry.discardAspects |= discardAspects;
entry.clearAspects &= ~discardAspects;
return;