Skip to content

Commit

Permalink
Main: MultiRenderTarget - devirtualize bindSurface
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Feb 9, 2025
1 parent aed9b71 commit 0322866
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
3 changes: 1 addition & 2 deletions OgreMain/include/OgreRenderTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ namespace Ogre
- Not all bound surfaces have the same size
- Not all bound surfaces have the same internal format
*/

virtual void bindSurface(size_t attachment, RenderTexture *target);
void bindSurface(size_t attachment, RenderTexture *target);

/** Unbind attachment.
*/
Expand Down
5 changes: 1 addition & 4 deletions RenderSystems/Direct3D11/src/OgreD3D11MultiRenderTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ namespace Ogre
if(mRenderTargets[y]->getWidth() != target->getWidth() ||
mRenderTargets[y]->getHeight() != target->getHeight())
{
OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
"MultiRenderTarget surfaces are not of same size",
"D3D11MultiRenderTarget::bindSurface"
);
OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "MultiRenderTarget surfaces are not of same size");
}
}

Expand Down
12 changes: 3 additions & 9 deletions RenderSystems/Direct3D9/src/OgreD3D9MultiRenderTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,15 @@ namespace Ogre
if (mRenderTargets[y]->getWidth() != buffer->getWidth() ||
mRenderTargets[y]->getHeight() != buffer->getHeight())
{
OGRE_EXCEPT(
Exception::ERR_INVALIDPARAMS,
"MultiRenderTarget surfaces are not of same size",
"D3D9MultiRenderTarget::bindSurface");
OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "MultiRenderTarget surfaces are not of same size");
}

if (Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability(RSC_MRT_SAME_BIT_DEPTHS)
&& (PixelUtil::getNumElemBits(mRenderTargets[y]->getFormat()) !=
PixelUtil::getNumElemBits(buffer->getFormat())))
{
OGRE_EXCEPT(
Exception::ERR_INVALIDPARAMS,
"MultiRenderTarget surfaces are not of same bit depth and hardware requires it",
"D3D9MultiRenderTarget::bindSurface"
);
OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
"MultiRenderTarget surfaces are not of same bit depth and hardware requires it");
}
}

Expand Down
4 changes: 1 addition & 3 deletions RenderSystems/Metal/src/OgreMetalMultiRenderTarget.mm
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ of this software and associated documentation files (the "Software"), to deal
if( mWidth != target->getWidth() && mHeight != target->getHeight() &&
mFSAA != target->getFSAA() )
{
OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS,
"MultiRenderTarget surfaces are not of same size",
"MetalMultiRenderTarget::bindSurface" );
OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "MultiRenderTarget surfaces are not of same size");
}
}

Expand Down

0 comments on commit 0322866

Please sign in to comment.