mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +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,
|
VkImageAspectFlags clearAspects,
|
||||||
VkClearValue clearValue) {
|
VkClearValue clearValue) {
|
||||||
for (auto& entry : m_deferredClears) {
|
for (auto& entry : m_deferredClears) {
|
||||||
if (entry.imageView == imageView) {
|
if (entry.imageView->checkSubresourceMatch(imageView)) {
|
||||||
entry.discardAspects &= ~clearAspects;
|
entry.discardAspects &= ~clearAspects;
|
||||||
entry.clearAspects |= clearAspects;
|
entry.clearAspects |= clearAspects;
|
||||||
|
|
||||||
@ -1882,7 +1882,7 @@ namespace dxvk {
|
|||||||
const Rc<DxvkImageView>& imageView,
|
const Rc<DxvkImageView>& imageView,
|
||||||
VkImageAspectFlags discardAspects) {
|
VkImageAspectFlags discardAspects) {
|
||||||
for (auto& entry : m_deferredClears) {
|
for (auto& entry : m_deferredClears) {
|
||||||
if (entry.imageView == imageView) {
|
if (entry.imageView->checkSubresourceMatch(imageView)) {
|
||||||
entry.discardAspects |= discardAspects;
|
entry.discardAspects |= discardAspects;
|
||||||
entry.clearAspects &= ~discardAspects;
|
entry.clearAspects &= ~discardAspects;
|
||||||
return;
|
return;
|
||||||
|
@ -469,6 +469,21 @@ namespace dxvk {
|
|||||||
return result;
|
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
|
* \brief Checks whether this view overlaps with another one
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user