Skip to content

Commit

Permalink
Review: FBO reset
Browse files Browse the repository at this point in the history
  • Loading branch information
grorp committed Nov 17, 2024
1 parent 9e38bc7 commit d3c0f1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions irr/src/COpenGLCoreCacheHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ class COpenGLCoreCacheHandler
frameBufferID = FrameBufferID;
}

void setFBO(GLuint frameBufferID, bool force=false)
void setFBO(GLuint frameBufferID)
{
if (FrameBufferID != frameBufferID || force) {
if (FrameBufferID != frameBufferID) {
Driver->irrGlBindFramebuffer(GL_FRAMEBUFFER, frameBufferID);
FrameBufferID = frameBufferID;
}
Expand Down
3 changes: 2 additions & 1 deletion irr/src/COpenGLDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,8 @@ void COpenGLDriver::blitRenderTarget(IRenderTarget *from, IRenderTarget *to)
0, 0, dst->getSize().Width, dst->getSize().Height,
GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT | GL.STENCIL_BUFFER_BIT, GL.NEAREST);

CacheHandler->setFBO(prev_fbo_id, true);
// This resets both read and draw framebuffer. Note that we bypass CacheHandler here.
GL.BindFramebuffer(GL.FRAMEBUFFER, prev_fbo_id);
}

// small helper function to create vertex buffer object address offsets
Expand Down
3 changes: 2 additions & 1 deletion irr/src/OpenGL/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,8 @@ void COpenGL3DriverBase::blitRenderTarget(IRenderTarget *from, IRenderTarget *to
0, 0, dst->getSize().Width, dst->getSize().Height,
GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT | GL.STENCIL_BUFFER_BIT, GL.NEAREST);

CacheHandler->setFBO(prev_fbo_id, true);
// This resets both read and draw framebuffer. Note that we bypass CacheHandler here.
GL.BindFramebuffer(GL.FRAMEBUFFER, prev_fbo_id);
}

//! draws a vertex primitive list
Expand Down

0 comments on commit d3c0f1c

Please sign in to comment.