mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 10:54:16 +01:00
[dxvk] Merge clears with different views but identical subresources
This commit is contained in:
parent
1c2edabbcb
commit
5f0f90f8d4
@ -1856,7 +1856,7 @@ namespace dxvk {
|
||||
VkImageAspectFlags clearAspects,
|
||||
VkClearValue clearValue) {
|
||||
for (auto& entry : m_deferredClears) {
|
||||
if (entry.imageView == imageView) {
|
||||
if (entry.imageView->checkSubresourceMatch(imageView)) {
|
||||
entry.discardAspects &= ~clearAspects;
|
||||
entry.clearAspects |= clearAspects;
|
||||
|
||||
@ -1882,7 +1882,7 @@ namespace dxvk {
|
||||
const Rc<DxvkImageView>& imageView,
|
||||
VkImageAspectFlags discardAspects) {
|
||||
for (auto& entry : m_deferredClears) {
|
||||
if (entry.imageView == imageView) {
|
||||
if (entry.imageView->checkSubresourceMatch(imageView)) {
|
||||
entry.discardAspects |= discardAspects;
|
||||
entry.clearAspects &= ~discardAspects;
|
||||
return;
|
||||
|
@ -469,6 +469,21 @@ namespace dxvk {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Checks whether this view matches another
|
||||
*
|
||||
* \param [in] view The other view to check
|
||||
* \returns \c true if the two views have the same subresources
|
||||
*/
|
||||
bool checkSubresourceMatch(const Rc<DxvkImageView>& view) const {
|
||||
if (this == view.ptr())
|
||||
return true;
|
||||
|
||||
return this->image() == view->image()
|
||||
&& this->subresources() == view->subresources()
|
||||
&& this->info().type == view->info().type;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Checks whether this view overlaps with another one
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user