diff options
Diffstat (limited to 'src/render/Framebuffer.cpp')
| -rw-r--r-- | src/render/Framebuffer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/render/Framebuffer.cpp b/src/render/Framebuffer.cpp index ae2ce2a6..ab5a14a3 100644 --- a/src/render/Framebuffer.cpp +++ b/src/render/Framebuffer.cpp @@ -12,6 +12,11 @@ bool CFramebuffer::alloc(int w, int h, uint32_t drmFormat) { uint32_t glFormat = NFormatUtils::drmFormatToGL(drmFormat); uint32_t glType = NFormatUtils::glFormatToType(glFormat); + if (drmFormat != m_drmFormat || m_size != Vector2D{w, h}) + release(); + + m_drmFormat = drmFormat; + if (!m_tex) { m_tex = makeShared<CTexture>(); m_tex->allocate(); |
