Graphics: Fix texture reuse when backbuffer is a proxy
This commit is contained in:
parent
c352e78e11
commit
c93a5f1975
|
|
@ -1089,14 +1089,8 @@ namespace Nz
|
|||
CheckExternalTexture(attachmentIndex, data);
|
||||
|
||||
// Final outputs cannot be reused
|
||||
for (std::size_t outputAttachmentIndex : m_backbufferOutputs)
|
||||
{
|
||||
if (attachmentIndex == outputAttachmentIndex)
|
||||
{
|
||||
if (std::find(m_backbufferOutputs.begin(), m_backbufferOutputs.end(), attachmentIndex) != m_backbufferOutputs.end())
|
||||
data.canReuse = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return textureId;
|
||||
}
|
||||
|
|
@ -1138,14 +1132,8 @@ namespace Nz
|
|||
CheckExternalTexture(attachmentIndex, data);
|
||||
|
||||
// Final outputs cannot be reused
|
||||
for (std::size_t outputAttachmentIndex : m_backbufferOutputs)
|
||||
{
|
||||
if (attachmentIndex == outputAttachmentIndex)
|
||||
{
|
||||
if (std::find(m_backbufferOutputs.begin(), m_backbufferOutputs.end(), attachmentIndex) != m_backbufferOutputs.end())
|
||||
data.canReuse = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return textureId;
|
||||
}
|
||||
|
|
@ -1186,14 +1174,8 @@ namespace Nz
|
|||
CheckExternalTexture(attachmentIndex, data);
|
||||
|
||||
// Final outputs cannot be reused
|
||||
for (std::size_t outputAttachmentIndex : m_backbufferOutputs)
|
||||
{
|
||||
if (attachmentIndex == outputAttachmentIndex)
|
||||
{
|
||||
if (std::find(m_backbufferOutputs.begin(), m_backbufferOutputs.end(), attachmentIndex) != m_backbufferOutputs.end())
|
||||
data.canReuse = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return textureId;
|
||||
}
|
||||
|
|
@ -1236,6 +1218,9 @@ namespace Nz
|
|||
if (m_externalTextures.contains(proxy.attachmentId))
|
||||
throw std::runtime_error("proxy attachments cannot be bound to external textures");
|
||||
|
||||
if (std::find(m_backbufferOutputs.begin(), m_backbufferOutputs.end(), attachmentIndex) != m_backbufferOutputs.end())
|
||||
m_pending.textures[textureId].canReuse = false;
|
||||
|
||||
return textureId;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue