mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Fixed the VRAM statistics overlay that was using megabytes instad of mebibytes.
This commit is contained in:
parent
295bb0c4c4
commit
d3d57ae69a
1
NEWS.md
1
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
|
||||
|
|
|
@ -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**
|
||||
|
||||
|
|
|
@ -502,7 +502,7 @@ void GuiMenu::openOtherSettings()
|
|||
auto s = new GuiSettings(mWindow, "OTHER SETTINGS");
|
||||
|
||||
// Maximum VRAM.
|
||||
auto max_vram = std::make_shared<SliderComponent>(mWindow, 80.f, 1000.f, 10.f, "MiB");
|
||||
auto max_vram = std::make_shared<SliderComponent>(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<SwitchComponent>(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()); });
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ private:
|
|||
int getSystemId(SystemData* system);
|
||||
|
||||
std::shared_ptr<GuiComponent> mCurrentView;
|
||||
std::map< SystemData*, std::shared_ptr<IGameListView> > mGameListViews;
|
||||
std::map<SystemData*, std::shared_ptr<IGameListView>> mGameListViews;
|
||||
std::shared_ptr<SystemView> mSystemListView;
|
||||
|
||||
Transform4x4f mCamera;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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<TextCache>
|
||||
(mDefaultFonts.at(1)->buildTextCache(ss.str(), 50.f, 50.f, 0xFF00FFFF));
|
||||
(mDefaultFonts.at(1)->buildTextCache(ss.str(), 30.f, 30.f, 0xFF00FFFF));
|
||||
}
|
||||
|
||||
mFrameTimeElapsed = 0;
|
||||
|
|
|
@ -114,16 +114,16 @@ void TextureDataManager::load(std::shared_ptr<TextureData> 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;
|
||||
|
|
Loading…
Reference in a new issue