mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-27 04:54:15 +01:00
[dxvk] Check view format as well when deferring clears
Otherwise, we may accidentally clear to an incorrect value. Fixes #2100.
This commit is contained in:
parent
30a1a29aa6
commit
de05728c8c
@ -1881,7 +1881,7 @@ namespace dxvk {
|
||||
VkImageAspectFlags clearAspects,
|
||||
VkClearValue clearValue) {
|
||||
for (auto& entry : m_deferredClears) {
|
||||
if (entry.imageView->checkSubresourceMatch(imageView)) {
|
||||
if (entry.imageView->matchesView(imageView)) {
|
||||
entry.imageView = imageView;
|
||||
entry.discardAspects &= ~clearAspects;
|
||||
entry.clearAspects |= clearAspects;
|
||||
@ -1908,7 +1908,7 @@ namespace dxvk {
|
||||
const Rc<DxvkImageView>& imageView,
|
||||
VkImageAspectFlags discardAspects) {
|
||||
for (auto& entry : m_deferredClears) {
|
||||
if (entry.imageView->checkSubresourceMatch(imageView)) {
|
||||
if (entry.imageView->matchesView(imageView)) {
|
||||
entry.imageView = imageView;
|
||||
entry.discardAspects |= discardAspects;
|
||||
entry.clearAspects &= ~discardAspects;
|
||||
|
@ -50,7 +50,7 @@ namespace dxvk {
|
||||
|
||||
int32_t DxvkFramebuffer::findAttachment(const Rc<DxvkImageView>& view) const {
|
||||
for (uint32_t i = 0; i < m_attachmentCount; i++) {
|
||||
if (getAttachment(i).view->checkSubresourceMatch(view))
|
||||
if (getAttachment(i).view->matchesView(view))
|
||||
return int32_t(i);
|
||||
}
|
||||
|
||||
|
@ -485,13 +485,14 @@ namespace dxvk {
|
||||
* \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 {
|
||||
bool matchesView(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;
|
||||
&& this->info().type == view->info().type
|
||||
&& this->info().format == view->info().format;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user