Renderer/RenderTexture: Fix size miscalculation
Former-commit-id: e1f3b7b72a3c9de192bab34021aa4e7fbf04a1ff
This commit is contained in:
parent
55b94f2bbf
commit
602dd561d2
|
|
@ -451,6 +451,8 @@ void NzRenderTexture::Detach(nzAttachmentPoint attachmentPoint, nzUInt8 index)
|
|||
attachement.texture = nullptr;
|
||||
}
|
||||
|
||||
m_impl->sizeUpdated = false;
|
||||
|
||||
if (attachement.attachmentPoint == nzAttachmentPoint_Color)
|
||||
{
|
||||
m_impl->drawBuffersUpdated = false;
|
||||
|
|
@ -923,10 +925,13 @@ void NzRenderTexture::UpdateSize() const
|
|||
m_impl->width = 0;
|
||||
m_impl->height = 0;
|
||||
for (Attachment& attachment : m_impl->attachments)
|
||||
{
|
||||
if (attachment.isUsed)
|
||||
{
|
||||
m_impl->height = std::max(m_impl->height, attachment.height);
|
||||
m_impl->width = std::max(m_impl->width, attachment.width);
|
||||
}
|
||||
}
|
||||
|
||||
m_impl->sizeUpdated = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue