Skip to content

Commit

Permalink
fixes for memoryless_tiler feature
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenegff committed Nov 21, 2024
1 parent 7b3a46e commit d9a5019
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
5 changes: 1 addition & 4 deletions RenderSystems/Metal/src/OgreMetalTextureGpuManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@ of this software and associated documentation files (the "Software"), to deal
//-----------------------------------------------------------------------------------
TextureGpu *MetalTextureGpuManager::createTextureGpuWindow( MetalWindow *window )
{
const RenderSystemCapabilities *capabilities =
Root::getSingleton().getRenderSystem()->getCapabilities();
const bool isTiler = capabilities->hasCapability( RSC_IS_TILER );
return OGRE_NEW MetalTextureGpuWindow( GpuPageOutStrategy::Discard, mVaoManager, "RenderWindow",
TextureFlags::NotTexture | TextureFlags::RenderToTexture |
TextureFlags::RenderWindowSpecific |
Expand All @@ -169,7 +166,7 @@ of this software and associated documentation files (the "Software"), to deal
return OGRE_NEW MetalTextureGpuRenderTarget(
GpuPageOutStrategy::Discard, mVaoManager, "RenderWindow DepthBuffer",
TextureFlags::NotTexture | TextureFlags::RenderToTexture |
( bMemoryLess ? TextureFlags::TilerMemoryless : 0 ) |
( isTiler && bMemoryLess ? TextureFlags::TilerMemoryless : 0 ) |
TextureFlags::RenderWindowSpecific | TextureFlags::DiscardableContent,
TextureTypes::Type2D, this );
}
Expand Down
11 changes: 3 additions & 8 deletions RenderSystems/Metal/src/OgreMetalWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,9 @@ static void SetupMetalWindowListeners( Ogre::MetalWindow *metalWindow, NSWindow
assert( rs );
const RenderSystemCapabilities *capabilities = rs->getCapabilities();
bool isTiler = capabilities->hasCapability( RSC_IS_TILER );
if( isTiler )
{
ConfigOptionMap &options = rs->getConfigOptions();
Ogre::ConfigOptionMap::iterator opt = options.find( "WindowMemoryless" );
if( opt != options.end() )
isTiler = opt->second.currentValue == "Yes";
}
if( isTiler )
TextureGpuManager *textureGpuManager = rs->getTextureGpuManager();
bool bAllowMemoryless = textureGpuManager->allowMemoryless();
if( isTiler && bAllowMemoryless )
{
if( @available( iOS 10, macOS 11, * ) )
desc.storageMode = MTLStorageModeMemoryless;
Expand Down

0 comments on commit d9a5019

Please sign in to comment.