From 51ec04b761ffb6ded26e2c268fc3ad82ed72cf87 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 7 Jan 2016 17:39:11 +0100 Subject: [PATCH] Changed: Added VideoMemory variable in cfg to force video memory to use (useful if Ryzom can't detect the correct amount of video memory or when using several clients at once) --HG-- branch : develop --- code/ryzom/client/src/client_cfg.cpp | 3 +++ code/ryzom/client/src/client_cfg.h | 2 ++ code/ryzom/client/src/init_main_loop.cpp | 26 ++++++++++++++++-------- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 76d730156..83f73afae 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -419,6 +419,7 @@ CClientConfig::CClientConfig() HDTextureInstalled = false; Fog = true; // Fog is on by default WaitVBL = false; + VideoMemory = 0; FXAA = true; @@ -1051,6 +1052,8 @@ void CClientConfig::setValues() // WaitVBL READ_BOOL_FV(WaitVBL) + // VideoMemory + READ_INT_FV(VideoMemory); READ_INT_DEV(TimerMode) diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index bbf9e4562..75c7698da 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -255,6 +255,8 @@ struct CClientConfig bool Fog; /// Enable/Disable VSync bool WaitVBL; + /// Force or auto-detect video memory (in MiB) + sint VideoMemory; /// Timer mode. 0 : QueryPerformanceCounter, 1 : timeGetTime. uint TimerMode; diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index a07f74de4..dc9a907b7 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -891,18 +891,28 @@ void initMainLoop() // only detect amount of video memory if using HD textures if (ClientCfg.HDEntityTexture) { - // determine video memory using 3D driver - videoMemory = Driver->getTotalVideoMemory(); + if (ClientCfg.VideoMemory <= 0) + { + // determine video memory using 3D driver + videoMemory = Driver->getTotalVideoMemory(); - // if unable to determine, use plaform methods - if (videoMemory < 0) videoMemory = CSystemUtils::getTotalVideoMemory(); + // if unable to determine, use plaform methods + if (videoMemory <= 0) videoMemory = CSystemUtils::getTotalVideoMemory(); - // in the worst case, use default value of 128 MiB - if (videoMemory < 0) videoMemory = 128 * 1024; + // in the worst case, use default value of 128 MiB + if (videoMemory <= 0) videoMemory = 128 * 1024; - videoMemory /= 1024; // size in MiB + videoMemory /= 1024; // size in MiB - nlinfo("Video memory detected: %d MiB", videoMemory); + nlinfo("Video memory detected: %d MiB", videoMemory); + } + else + { + // force video memory (at least 32 MiB) + videoMemory = ClientCfg.VideoMemory < 32 ? 32:ClientCfg.VideoMemory; + + nlinfo("Video memory forced: %d MiB", videoMemory); + } } else {