OpenGLRenderer: Fix FboFramebuffer making context switches

When a window was created and rendered onto, FBO rendering was made on the device reference context which required a context switch.

This has been fixed with OpenGLFboFramebuffer managing a per-context framebuffer and creating one when needed
This commit is contained in:
SirLynix
2023-02-26 13:43:21 +01:00
parent 2e8ea0e887
commit 421e684344
5 changed files with 115 additions and 50 deletions

View File

@@ -7,9 +7,9 @@
namespace Nz
{
inline const Vector2ui& OpenGLFboFramebuffer::GetAttachmentSize(std::size_t i) const
inline Vector2ui OpenGLFboFramebuffer::GetAttachmentSize(std::size_t i) const
{
return m_attachmentSizes[i];
return Vector2ui(m_attachments[i]->GetSize());
}
}