mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Reduce innecesary changes on Render Target textures.
This commit is contained in:
parent
c354f59b72
commit
c0b2e6536b
7 changed files with 29 additions and 9 deletions
|
|
@ -218,24 +218,35 @@ void RenderFormatToken::_updateTargets()
|
|||
// Update color target
|
||||
if(mColorFormat != GFXFormat_COUNT)
|
||||
{
|
||||
// try reuse of old color texture
|
||||
if( !mTargetColorTexture[i] || mTargetColorTexture[i].getFormat() != mColorFormat
|
||||
|| mTargetColorTexture[i].getWidthHeight() != rtSize)
|
||||
{
|
||||
mTargetColorTexture[i].set( rtSize.x, rtSize.y, mColorFormat,
|
||||
&GFXDefaultRenderTargetProfile, avar( "%s() - (line %d)", __FUNCTION__, __LINE__ ),
|
||||
1, mTargetAALevel );
|
||||
mTargetChain[i]->attachTexture( GFXTextureTarget::Color0, mTargetColorTexture[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mTargetChain[i]->attachTexture( GFXTextureTarget::Color0, mTargetColorTexture[i] );
|
||||
|
||||
|
||||
// Update depth target
|
||||
if(mDepthFormat != GFXFormat_COUNT)
|
||||
{
|
||||
// try reuse of old depth texture
|
||||
if( !mTargetDepthStencilTexture[i] || mTargetDepthStencilTexture[i].getFormat() != mColorFormat
|
||||
|| mTargetDepthStencilTexture[i].getWidthHeight() != rtSize)
|
||||
{
|
||||
mTargetDepthStencilTexture[i].set( rtSize.x, rtSize.y, mDepthFormat,
|
||||
&GFXDefaultZTargetProfile, avar( "%s() - (line %d)", __FUNCTION__, __LINE__ ),
|
||||
1, mTargetAALevel );
|
||||
mTargetChain[i]->attachTexture( GFXTextureTarget::DepthStencil, mTargetDepthStencilTexture[i] );
|
||||
}
|
||||
}
|
||||
|
||||
mTargetChain[i]->attachTexture( GFXTextureTarget::DepthStencil, mTargetDepthStencilTexture[i] );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue