Cache 60 FPS requirement

This commit is contained in:
iota97 2020-09-15 07:45:57 +02:00
parent 0c885db052
commit fe86f257b5
5 changed files with 6 additions and 2 deletions

View file

@ -806,6 +806,7 @@ static ConfigSetting graphicsSettings[] = {
ReportedConfigSetting("SplineBezierQuality", &g_Config.iSplineBezierQuality, 2, true, true),
ReportedConfigSetting("HardwareTessellation", &g_Config.bHardwareTessellation, false, true, true),
ConfigSetting("TextureShader", &g_Config.sTextureShaderName, "Off", true, true),
ConfigSetting("ShaderChainRequires60FPS", &g_Config.bShaderChainRequires60FPS, false, true, true),
ReportedConfigSetting("MemBlockTransferGPU", &g_Config.bBlockTransferGPU, true, true, true),
ReportedConfigSetting("DisableSlowFramebufEffects", &g_Config.bDisableSlowFramebufEffects, false, true, true),

View file

@ -215,6 +215,7 @@ public:
std::vector<std::string> vPostShaderNames; // Off for chain end (only Off for no shader)
std::map<std::string, float> mPostShaderSetting;
bool bShaderChainRequires60FPS;
std::string sTextureShaderName;
bool bGfxDebugOutput;
bool bGfxDebugSplitSubmit;

View file

@ -763,7 +763,7 @@ void __DisplayFlip(int cyclesLate) {
// postEffectRequiresFlip is not compatible with frameskip unthrottling, see #12325.
if (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE && !(unthrottleNeedsSkip && !FrameTimingThrottled())) {
postEffectRequiresFlip = duplicateFrames || PostShaderChainRequires60FPS(GetFullPostShadersChain(g_Config.vPostShaderNames));
postEffectRequiresFlip = duplicateFrames || g_Config.bShaderChainRequires60FPS;
}
const bool fbDirty = gpu->FramebufferDirty();

View file

@ -311,7 +311,7 @@ void GameSettingsScreen::CreateViews() {
std::vector<std::string> alreadyAddedShader;
for (int i = 0; i < g_Config.vPostShaderNames.size() && i < ARRAY_SIZE(shaderNames_); ++i) {
// Vector pointer get invalidated on resize, cache name to have always a valid reference for drawing
// Vector element pointer get invalidated on resize, cache name to have always a valid reference in the rendering thread
shaderNames_[i] = g_Config.vPostShaderNames[i];
postProcChoice_ = graphicsSettings->Add(new ChoiceWithValueDisplay(&shaderNames_[i], StringFromFormat("%s #%d", gr->T("Postprocessing Shader"), i + 1), &PostShaderTranslateName));
postProcChoice_->OnClick.Add([=](EventParams &e) {
@ -1257,6 +1257,7 @@ void GameSettingsScreen::update() {
}
if (g_ShaderNameListChanged) {
g_ShaderNameListChanged = false;
g_Config.bShaderChainRequires60FPS = PostShaderChainRequires60FPS(GetFullPostShadersChain(g_Config.vPostShaderNames));
RecreateViews();
}
}

View file

@ -1070,6 +1070,7 @@ namespace MainWindow {
g_Config.vPostShaderNames.push_back(availableShaders[index]);
g_Config.vPostShaderNames.push_back("Off");
g_ShaderNameListChanged = true;
g_Config.bShaderChainRequires60FPS = PostShaderChainRequires60FPS(GetFullPostShadersChain(g_Config.vPostShaderNames));
NativeMessageReceived("gpu_resized", "");
break;
}