From 4c58ba82782cac215b4b3b98fbac6df2936913ae Mon Sep 17 00:00:00 2001 From: Eugene Golushkov Date: Thu, 21 Nov 2024 22:46:30 +0100 Subject: [PATCH] fixes for memoryless_tiler feature --- RenderSystems/Metal/src/OgreMetalTextureGpuManager.mm | 5 +---- RenderSystems/Metal/src/OgreMetalWindow.mm | 11 +++-------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/RenderSystems/Metal/src/OgreMetalTextureGpuManager.mm b/RenderSystems/Metal/src/OgreMetalTextureGpuManager.mm index 92d549c0b9..16ebe84ede 100644 --- a/RenderSystems/Metal/src/OgreMetalTextureGpuManager.mm +++ b/RenderSystems/Metal/src/OgreMetalTextureGpuManager.mm @@ -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 | @@ -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 ); } diff --git a/RenderSystems/Metal/src/OgreMetalWindow.mm b/RenderSystems/Metal/src/OgreMetalWindow.mm index 4d926b9f6d..7a10e726cf 100644 --- a/RenderSystems/Metal/src/OgreMetalWindow.mm +++ b/RenderSystems/Metal/src/OgreMetalWindow.mm @@ -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 = mTextureManager->allowMemoryless(); + if( isTiler && bAllowMemoryless ) { if( @available( iOS 10, macOS 11, * ) ) desc.storageMode = MTLStorageModeMemoryless;