Add a setting (in developer tools) to control texture replacement load speed

This commit is contained in:
Henrik Rydgård
2025-04-22 20:57:32 +02:00
parent b7dae29865
commit f3127346d4
5 changed files with 31 additions and 1 deletions
+1
View File
@@ -713,6 +713,7 @@ static const ConfigSetting graphicsSettings[] = {
ConfigSetting("ReplaceTextures", &g_Config.bReplaceTextures, true, CfgFlag::PER_GAME | CfgFlag::REPORT),
ConfigSetting("SaveNewTextures", &g_Config.bSaveNewTextures, false, CfgFlag::PER_GAME | CfgFlag::REPORT),
ConfigSetting("IgnoreTextureFilenames", &g_Config.bIgnoreTextureFilenames, false, CfgFlag::PER_GAME),
ConfigSetting("ReplacementTextureLoadSpeed", &g_Config.iReplacementTextureLoadSpeed, 0, CfgFlag::PER_GAME),
ConfigSetting("TexScalingLevel", &g_Config.iTexScalingLevel, 1, CfgFlag::PER_GAME | CfgFlag::REPORT),
ConfigSetting("TexScalingType", &g_Config.iTexScalingType, 0, CfgFlag::PER_GAME | CfgFlag::REPORT),
+1
View File
@@ -230,6 +230,7 @@ public:
int bHighQualityDepth;
bool bReplaceTextures;
bool bSaveNewTextures;
int iReplacementTextureLoadSpeed;
bool bIgnoreTextureFilenames;
int iTexScalingLevel; // 0 = auto, 1 = off, 2 = 2x, ..., 5 = 5x
int iTexScalingType; // 0 = xBRZ, 1 = Hybrid
+7
View File
@@ -86,6 +86,13 @@ enum TextureFiltering {
TEX_FILTER_AUTO_MAX_QUALITY = 4,
};
enum ReplacementTextureLoadSpeed {
SLOW = 0,
MEDIUM = 1,
FAST = 2,
INSTANT = 3,
};
enum BufferFilter {
SCALE_LINEAR = 1,
SCALE_NEAREST = 2,
+18 -1
View File
@@ -133,8 +133,25 @@ void TextureCacheCommon::StartFrame() {
if (fps <= 5.0f) {
fps = 60.0f;
}
float baseValue = 0.5f;
switch (g_Config.iReplacementTextureLoadSpeed) {
case (int)ReplacementTextureLoadSpeed::SLOW:
baseValue = 0.5f;
break;
case (int)ReplacementTextureLoadSpeed::MEDIUM:
baseValue = 0.75f;
break;
case (int)ReplacementTextureLoadSpeed::FAST:
baseValue = 1.0f;
break;
case (int)ReplacementTextureLoadSpeed::INSTANT:
baseValue = 100000.0f; // no budget limit, effectively.
break;
}
// Allow spending half a frame on uploading textures.
replacementFrameBudgetSeconds_ = 0.5f / fps;
replacementFrameBudgetSeconds_ = baseValue / fps;
if ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS) {
gpuStats.numReplacerTrackedTex = replacer_.GetNumTrackedTextures();
+4
View File
@@ -112,6 +112,10 @@ void DeveloperToolsScreen::CreateTextureReplacementTab(UI::LinearLayout *list) {
return UI::EVENT_DONE;
});
}
static const char *texLoadSpeeds[] = { "Slow (smooth)", "Medium", "Fast", "Instant (may stutter)" };
PopupMultiChoice *texLoadSpeed = list->Add(new PopupMultiChoice(&g_Config.iReplacementTextureLoadSpeed, dev->T("Texture load speed"), texLoadSpeeds, 0, ARRAY_SIZE(texLoadSpeeds), I18NCat::DEVELOPER, screenManager()));
texLoadSpeed->SetChoiceIcon(3, ImageID("I_WARNING"));
}
void DeveloperToolsScreen::CreateGeneralTab(UI::LinearLayout *list) {