Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Matias N. Goldberg <[email protected]>
  • Loading branch information
darksylinc committed Dec 11, 2022
1 parent 9405afb commit 0b05a60
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ogre2/src/Ogre2GpuRays.cc
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ void Ogre2GpuRays::Destroy()

auto engine = Ogre2RenderEngine::Instance();
auto ogreRoot = engine->OgreRoot();
auto textureGpuManager = ogreRoot->getRenderSystem()->getTextureGpuManager();

Ogre::CompositorManager2 *ogreCompMgr = ogreRoot->getCompositorManager2();

Expand All @@ -616,17 +617,15 @@ void Ogre2GpuRays::Destroy()
}
if (this->dataPtr->firstPassTextures[i])
{
ogreRoot->getRenderSystem()->getTextureGpuManager()->destroyTexture(
this->dataPtr->firstPassTextures[i]);
textureGpuManager->destroyTexture(this->dataPtr->firstPassTextures[i]);
this->dataPtr->firstPassTextures[i] = nullptr;
}
}

// remove 2nd pass texture, material, compositor
if (this->dataPtr->secondPassTexture)
{
ogreRoot->getRenderSystem()->getTextureGpuManager()->destroyTexture(
this->dataPtr->secondPassTexture);
textureGpuManager->destroyTexture(this->dataPtr->secondPassTexture);
this->dataPtr->secondPassTexture = nullptr;
}

Expand All @@ -636,7 +635,6 @@ void Ogre2GpuRays::Destroy()
this->dataPtr->ogreCompositorWorkspace2nd = nullptr;
}

auto textureGpuManager = ogreRoot->getRenderSystem()->getTextureGpuManager();
if (this->dataPtr->cubeUVTexture)
{
textureGpuManager->destroyTexture(this->dataPtr->cubeUVTexture);
Expand Down

0 comments on commit 0b05a60

Please sign in to comment.