Skip to content

Commit

Permalink
Main: RenderTarget - devirtualise detachDepthBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Feb 3, 2025
1 parent c230ce6 commit 6b856e2
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 44 deletions.
2 changes: 1 addition & 1 deletion OgreMain/include/OgreRenderTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace Ogre {
//Returns false if couldn't attach
virtual bool attachDepthBuffer( DepthBuffer *depthBuffer );

virtual void detachDepthBuffer();
void detachDepthBuffer();

/** Detaches DepthBuffer without notifying it from the detach.
Useful when called from the DepthBuffer while it iterates through attached
Expand Down
2 changes: 1 addition & 1 deletion OgreMain/src/OgreRenderTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace Ogre {
if( mDepthBuffer )
{
mDepthBuffer->_notifyRenderTargetDetached( this );
mDepthBuffer = 0;
_detachDepthBuffer();
}
}

Expand Down
1 change: 0 additions & 1 deletion RenderSystems/GL/include/OgreGLFBOMultiRenderTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ namespace Ogre {

/// Override so we can attach the depth buffer to the FBO
bool attachDepthBuffer( DepthBuffer *depthBuffer ) override;
void detachDepthBuffer() override;
void _detachDepthBuffer() override;
private:
void bindSurfaceImpl(size_t attachment, RenderTexture *target) override;
Expand Down
1 change: 0 additions & 1 deletion RenderSystems/GL/include/OgreGLFBORenderTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ namespace Ogre {

/// Override so we can attach the depth buffer to the FBO
bool attachDepthBuffer( DepthBuffer *depthBuffer ) override;
void detachDepthBuffer() override;
void _detachDepthBuffer() override;

GLContext* getContext() const override { return mFB.getContext(); }
Expand Down
6 changes: 0 additions & 6 deletions RenderSystems/GL/src/OgreGLFBOMultiRenderTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@ namespace Ogre {
return result;
}
//-----------------------------------------------------------------------------
void GLFBOMultiRenderTarget::detachDepthBuffer()
{
fbo.detachDepthBuffer();
MultiRenderTarget::detachDepthBuffer();
}
//-----------------------------------------------------------------------------
void GLFBOMultiRenderTarget::_detachDepthBuffer()
{
fbo.detachDepthBuffer();
Expand Down
6 changes: 0 additions & 6 deletions RenderSystems/GL/src/OgreGLFBORenderTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@ namespace Ogre {
return result;
}
//-----------------------------------------------------------------------------
void GLFBORenderTexture::detachDepthBuffer()
{
mFB.detachDepthBuffer();
GLRenderTexture::detachDepthBuffer();
}
//-----------------------------------------------------------------------------
void GLFBORenderTexture::_detachDepthBuffer()
{
mFB.detachDepthBuffer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace Ogre {

/// Override so we can attach the depth buffer to the FBO
bool attachDepthBuffer( DepthBuffer *depthBuffer ) override;
void detachDepthBuffer() override;
void _detachDepthBuffer() override;
private:
void bindSurfaceImpl(size_t attachment, RenderTexture *target) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace Ogre {

/// Override so we can attach the depth buffer to the FBO
bool attachDepthBuffer( DepthBuffer *depthBuffer ) override;
void detachDepthBuffer() override;
void _detachDepthBuffer() override;

GLContext* getContext() const override { return mFB.getContext(); }
Expand Down
6 changes: 0 additions & 6 deletions RenderSystems/GL3Plus/src/OgreGL3PlusFBOMultiRenderTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ namespace Ogre {
return result;
}

void GL3PlusFBOMultiRenderTarget::detachDepthBuffer()
{
fbo.detachDepthBuffer();
MultiRenderTarget::detachDepthBuffer();
}

void GL3PlusFBOMultiRenderTarget::_detachDepthBuffer()
{
fbo.detachDepthBuffer();
Expand Down
6 changes: 0 additions & 6 deletions RenderSystems/GL3Plus/src/OgreGL3PlusFBORenderTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ namespace Ogre {
return result;
}

void GL3PlusFBORenderTexture::detachDepthBuffer()
{
mFB.detachDepthBuffer();
GLRenderTexture::detachDepthBuffer();
}

void GL3PlusFBORenderTexture::_detachDepthBuffer()
{
mFB.detachDepthBuffer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace Ogre {

/// Override so we can attach the depth buffer to the FBO
bool attachDepthBuffer( DepthBuffer *depthBuffer ) override;
void detachDepthBuffer() override;
void _detachDepthBuffer() override;
private:
void bindSurfaceImpl(size_t attachment, RenderTexture *target) override;
Expand Down
1 change: 0 additions & 1 deletion RenderSystems/GLES2/include/OgreGLES2FBORenderTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace Ogre {

/// Override so we can attach the depth buffer to the FBO
bool attachDepthBuffer( DepthBuffer *depthBuffer ) override;
void detachDepthBuffer() override;
void _detachDepthBuffer() override;

GLContext* getContext() const override { return mFB.getContext(); }
Expand Down
6 changes: 0 additions & 6 deletions RenderSystems/GLES2/src/OgreGLES2FBOMultiRenderTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ namespace Ogre {
return result;
}
//-----------------------------------------------------------------------------
void GLES2FBOMultiRenderTarget::detachDepthBuffer()
{
fbo.detachDepthBuffer();
MultiRenderTarget::detachDepthBuffer();
}
//-----------------------------------------------------------------------------
void GLES2FBOMultiRenderTarget::_detachDepthBuffer()
{
fbo.detachDepthBuffer();
Expand Down
6 changes: 0 additions & 6 deletions RenderSystems/GLES2/src/OgreGLES2FBORenderTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ namespace Ogre {
return result;
}
//-----------------------------------------------------------------------------
void GLES2FBORenderTexture::detachDepthBuffer()
{
mFB.detachDepthBuffer();
GLRenderTexture::detachDepthBuffer();
}
//-----------------------------------------------------------------------------
void GLES2FBORenderTexture::_detachDepthBuffer()
{
mFB.detachDepthBuffer();
Expand Down

0 comments on commit 6b856e2

Please sign in to comment.