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