gl_engine: Fix GlRenderTarget reset function

- Avoid deleting the framebuffer when mFbo == GL_INVALID_VALUE, as this is not a valid framebuffer object.
This commit is contained in:
Sungun No 2025-07-18 03:23:38 +09:00
parent 7b59b1869d
commit e3e0ab8579

View file

@ -77,7 +77,7 @@ void GlRenderTarget::init(uint32_t width, uint32_t height, GLint resolveId)
void GlRenderTarget::reset()
{
if (mFbo == 0) return;
if (mFbo == 0 || mFbo == GL_INVALID_VALUE) return;
GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, 0));
GL_CHECK(glDeleteFramebuffers(1, &mFbo));
GL_CHECK(glDeleteRenderbuffers(1, &mColorBuffer));