From 602dd561d2e384cc232c8d69e843b59a99ad48f5 Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 13 May 2015 14:03:26 +0200 Subject: [PATCH] Renderer/RenderTexture: Fix size miscalculation Former-commit-id: e1f3b7b72a3c9de192bab34021aa4e7fbf04a1ff --- src/Nazara/Renderer/RenderTexture.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Nazara/Renderer/RenderTexture.cpp b/src/Nazara/Renderer/RenderTexture.cpp index e83ac9467..47b4d569f 100644 --- a/src/Nazara/Renderer/RenderTexture.cpp +++ b/src/Nazara/Renderer/RenderTexture.cpp @@ -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; @@ -924,8 +926,11 @@ void NzRenderTexture::UpdateSize() const m_impl->height = 0; for (Attachment& attachment : m_impl->attachments) { - m_impl->height = std::max(m_impl->height, attachment.height); - m_impl->width = std::max(m_impl->width, attachment.width); + 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;