Tweak memory detection algorithm.

This commit is contained in:
Shyotl
2019-07-02 21:14:37 -05:00
parent 4622be4cef
commit b5cb6459b0
6 changed files with 104 additions and 44 deletions

View File

@@ -443,7 +443,7 @@ LLDXDevice *LLDXHardware::findDevice(const std::string &vendor, const std::strin
}
*/
BOOL LLDXHardware::getInfo(BOOL vram_only)
BOOL LLDXHardware::getInfo(BOOL vram_only, S32Megabytes system_ram)
{
LLTimer hw_timer;
BOOL ok = FALSE;
@@ -543,6 +543,11 @@ BOOL LLDXHardware::getInfo(BOOL vram_only)
// Dump the string as an int into the structure
char *stopstring;
mVRAM = strtol(ram_str.c_str(), &stopstring, 10);
mVRAM -= ((S32)system_ram/2) + 1; // Ignore shared memory pool.
if (mVRAM <= 0)
{
mVRAM = (S32)system_ram / 2; // Integrated graphics perhaps? Use half system ram.
}
LL_INFOS("AppInit") << "VRAM Detected: " << mVRAM << " DX9 string: " << ram_str << LL_ENDL;
}

View File

@@ -92,7 +92,7 @@ public:
// Returns TRUE on success.
// vram_only TRUE does a "light" probe.
BOOL getInfo(BOOL vram_only);
BOOL getInfo(BOOL vram_only, S32Megabytes sytem_ram);
S32 getVRAM() const { return mVRAM; }