Renderer/RenderTexture: Fix Detach() not removing color targets
Former-commit-id: 058d95e1952f2316333be380cb6418c121db4a32
This commit is contained in:
parent
c0ee9d04b5
commit
5556c38901
|
|
@ -154,9 +154,6 @@ bool NzRenderTexture::AttachBuffer(nzAttachmentPoint attachmentPoint, nzUInt8 in
|
|||
InvalidateSize();
|
||||
InvalidateTargets();
|
||||
|
||||
if (attachmentPoint == nzAttachmentPoint_Color && !m_impl->userDefinedTargets)
|
||||
m_impl->colorTargets.push_back(index);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -291,9 +288,6 @@ bool NzRenderTexture::AttachTexture(nzAttachmentPoint attachmentPoint, nzUInt8 i
|
|||
InvalidateSize();
|
||||
InvalidateTargets();
|
||||
|
||||
if (attachmentPoint == nzAttachmentPoint_Color && !m_impl->userDefinedTargets)
|
||||
m_impl->colorTargets.push_back(index);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -828,6 +822,15 @@ void NzRenderTexture::UpdateSize() const
|
|||
|
||||
void NzRenderTexture::UpdateTargets() const
|
||||
{
|
||||
if (!m_impl->userDefinedTargets)
|
||||
{
|
||||
m_impl->colorTargets.clear();
|
||||
|
||||
unsigned int colorIndex = 0;
|
||||
for (unsigned int index = attachmentIndex[nzAttachmentPoint_Color]; index < m_impl->attachments.size(); ++index)
|
||||
m_impl->colorTargets.push_back(colorIndex++);
|
||||
}
|
||||
|
||||
if (m_impl->colorTargets.empty())
|
||||
{
|
||||
m_impl->drawBuffers.resize(1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue