diff --git a/NEWS.md b/NEWS.md index 5b062669f..4fac0b4fa 100644 --- a/NEWS.md +++ b/NEWS.md @@ -75,6 +75,7 @@ Many bugs have been fixed, and numerous features that were only partially implem * Deleting a game from the metadata editor did not delete the game media files or the entry in the gamelist.xml file * SystemView didn't properly loop the systems if only two systems were available * Hidden files still showed up if they had a gamelist.xml entry +* VRAM statistics overlay was somewhat broken and incorrectly displayed numbers in megabytes instead of mebibytes * On Unix, adding a hidden folder with a game in it crashed the application on startup * If the user tried to enter a blank game name in the metadata editor, the application would crash upon saving * The SliderComponent knob position was set incorrectly if the minimum value was not zero diff --git a/USERGUIDE.md b/USERGUIDE.md index 82c736ffe..db6d26873 100644 --- a/USERGUIDE.md +++ b/USERGUIDE.md @@ -662,7 +662,7 @@ These are mostly technical settings. **VRAM limit** -The amount of video RAM to use for the application. Defaults to 160 MiB which seems to work fine most of the time. The allowed range is 80 to 1000 MiB. If you try to set it lower or higher than this by passing such values as command line parameters or edit the es_settings.cfg file manually, ES will log a warning and automatically adjust the value within the allowable range. +The amount of video RAM to use for the application. Defaults to 128 MiB which seems to work fine most of the time. The allowed range is 80 to 1024 MiB. If you try to set it lower or higher than this by passing such values as command line parameters or edit the es_settings.cfg file manually, ES will log a warning and automatically adjust the value within the allowable range. **Fullscreen mode (requires restart) - Unix only** diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 63c7accc3..80fc5669a 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -502,7 +502,7 @@ void GuiMenu::openOtherSettings() auto s = new GuiSettings(mWindow, "OTHER SETTINGS"); // Maximum VRAM. - auto max_vram = std::make_shared(mWindow, 80.f, 1000.f, 10.f, "MiB"); + auto max_vram = std::make_shared(mWindow, 80.f, 1024.f, 8.f, "MiB"); max_vram->setValue((float)(Settings::getInstance()->getInt("MaxVRAM"))); s->addWithLabel("VRAM LIMIT", max_vram); s->addSaveFunc([max_vram] { Settings::getInstance()->setInt("MaxVRAM", @@ -679,7 +679,7 @@ void GuiMenu::openOtherSettings() // GPU statistics. auto gpu_statistics = std::make_shared(mWindow); gpu_statistics->setState(Settings::getInstance()->getBool("DrawGPUStatistics")); - s->addWithLabel("DRAW GPU STATISTICS OVERLAY", gpu_statistics); + s->addWithLabel("GPU STATISTICS OVERLAY", gpu_statistics); s->addSaveFunc([gpu_statistics] { Settings::getInstance()->setBool("DrawGPUStatistics", gpu_statistics->getState()); }); diff --git a/es-app/src/views/ViewController.h b/es-app/src/views/ViewController.h index 7f69785f9..1eda75ac2 100644 --- a/es-app/src/views/ViewController.h +++ b/es-app/src/views/ViewController.h @@ -105,7 +105,7 @@ private: int getSystemId(SystemData* system); std::shared_ptr mCurrentView; - std::map< SystemData*, std::shared_ptr > mGameListViews; + std::map> mGameListViews; std::shared_ptr mSystemListView; Transform4x4f mCamera; diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index 891cde864..7fbf2d3e5 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -170,7 +170,7 @@ void Settings::setDefaults() #ifdef _RPI_ mIntMap["MaxVRAM"] = 80; #else - mIntMap["MaxVRAM"] = 160; + mIntMap["MaxVRAM"] = 128; #endif #ifdef __unix__ mStringMap["FullscreenMode"] = "normal"; diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index 31b7cba34..e9a895105 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -212,19 +212,20 @@ void Window::update(int deltaTime) // FPS. ss << std::fixed << std::setprecision(1) << - (1000.0f * (float)mFrameCountElapsed / (float)mFrameTimeElapsed) << "fps, "; + (1000.0f * (float)mFrameCountElapsed / (float)mFrameTimeElapsed) << " FPS ("; ss << std::fixed << std::setprecision(2) << - ((float)mFrameTimeElapsed / (float)mFrameCountElapsed) << "ms"; + ((float)mFrameTimeElapsed / (float)mFrameCountElapsed) << " ms)"; // VRAM. - float textureVramUsageMb = TextureResource::getTotalMemUsage() / 1000.0f / 1000.0f; - float textureTotalUsageMb = TextureResource::getTotalTextureSize() / 1000.0f / 1000.0f; - float fontVramUsageMb = Font::getTotalMemUsage() / 1000.0f / 1000.0f; + float textureVramUsageMiB = TextureResource::getTotalMemUsage() / 1024.0f / 1024.0f; + float textureTotalUsageMiB = TextureResource::getTotalTextureSize() / 1024.0f / 1024.0f; + float fontVramUsageMiB = Font::getTotalMemUsage() / 1024.0f / 1024.0f; - ss << "\nFont VRAM: " << fontVramUsageMb << " Texture VRAM: " << textureVramUsageMb << - " (Max Texture VRAM: " << textureTotalUsageMb << ")"; + ss << "\nFont VRAM: " << fontVramUsageMiB << " MiB\nTexture VRAM: " << + textureVramUsageMiB << " MiB\nMax Texture VRAM: " << + textureTotalUsageMiB << " MiB"; mFrameDataText = std::unique_ptr - (mDefaultFonts.at(1)->buildTextCache(ss.str(), 50.f, 50.f, 0xFF00FFFF)); + (mDefaultFonts.at(1)->buildTextCache(ss.str(), 30.f, 30.f, 0xFF00FFFF)); } mFrameTimeElapsed = 0; diff --git a/es-core/src/resources/TextureDataManager.cpp b/es-core/src/resources/TextureDataManager.cpp index 5b9f64142..8bdabe050 100644 --- a/es-core/src/resources/TextureDataManager.cpp +++ b/es-core/src/resources/TextureDataManager.cpp @@ -114,16 +114,16 @@ void TextureDataManager::load(std::shared_ptr tex, bool block) size_t settingVRAM = (size_t)Settings::getInstance()->getInt("MaxVRAM"); if (settingVRAM < 80) { - LOG(LogWarning) << "MaxVRAM set too low at " << settingVRAM << " MiB, setting it to the " - "minimum value of 80 MiB."; + LOG(LogWarning) << "MaxVRAM is too low at " << settingVRAM << + " MiB, setting it to the minimum allowed value of 80 MiB."; Settings::getInstance()->setInt("MaxVRAM", 80); settingVRAM = 80; } - else if (settingVRAM > 1000) { - LOG(LogWarning) << "MaxVRAM set too high at " << settingVRAM << " MiB, setting it to the " - "maximum value of 1000 MiB."; - Settings::getInstance()->setInt("MaxVRAM", 1000); - settingVRAM = 1000; + else if (settingVRAM > 1024) { + LOG(LogWarning) << "MaxVRAM is too high at " << settingVRAM << + " MiB, setting it to the maximum allowed value of 1024 MiB."; + Settings::getInstance()->setInt("MaxVRAM", 1024); + settingVRAM = 1024; } size_t max_texture = settingVRAM * 1024 * 1024;