Skip to content

Commit

Permalink
Ogre with memoryless: do not check RSC_IS_TILER when we ask allowMemo…
Browse files Browse the repository at this point in the history
…ryless(), because this setAllowMemoryless() has already checked RSC_IS_TILER
  • Loading branch information
dyunchik authored and eugenegff committed Nov 22, 2024
1 parent d9a5019 commit 229e7c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions RenderSystems/Metal/src/OgreMetalTextureGpuManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,10 @@ of this software and associated documentation files (the "Software"), to deal
//-----------------------------------------------------------------------------------
TextureGpu *MetalTextureGpuManager::createWindowDepthBuffer( const bool bMemoryLess )
{
const RenderSystemCapabilities *capabilities =
Root::getSingleton().getRenderSystem()->getCapabilities();
const bool isTiler = capabilities->hasCapability( RSC_IS_TILER );
return OGRE_NEW MetalTextureGpuRenderTarget(
GpuPageOutStrategy::Discard, mVaoManager, "RenderWindow DepthBuffer",
TextureFlags::NotTexture | TextureFlags::RenderToTexture |
( isTiler && bMemoryLess ? TextureFlags::TilerMemoryless : 0 ) |
( bMemoryLess && allowMemoryless() ? TextureFlags::TilerMemoryless : 0 ) |
TextureFlags::RenderWindowSpecific | TextureFlags::DiscardableContent,
TextureTypes::Type2D, this );
}
Expand Down
4 changes: 1 addition & 3 deletions RenderSystems/Metal/src/OgreMetalWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,9 @@ static void SetupMetalWindowListeners( Ogre::MetalWindow *metalWindow, NSWindow
desc.storageMode = MTLStorageModePrivate;
RenderSystem *rs = Root::getSingleton().getRenderSystem();
assert( rs );
const RenderSystemCapabilities *capabilities = rs->getCapabilities();
bool isTiler = capabilities->hasCapability( RSC_IS_TILER );
TextureGpuManager *textureGpuManager = rs->getTextureGpuManager();
bool bAllowMemoryless = textureGpuManager->allowMemoryless();
if( isTiler && bAllowMemoryless )
if( bAllowMemoryless )
{
if( @available( iOS 10, macOS 11, * ) )
desc.storageMode = MTLStorageModeMemoryless;
Expand Down

0 comments on commit 229e7c1

Please sign in to comment.