Postshader: Reset ini keys for defaults.

Should fix the Vignette shader defaults, see #16562.
This commit is contained in:
Unknown W. Brackets committed 2022-12-12 19:11:20 -08:00
1 parent f202029d0b
commit fe470c790e
5 files changed
+15 -15

No files matched your search

+4 -4
View File
@@ -1417,10 +1417,10 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
Section *postShaderSetting = iniFile.GetOrCreateSection("PostShaderSetting"); Section *postShaderSetting = iniFile.GetOrCreateSection("PostShaderSetting");
if (IsVREnabled() && !postShadersInitialized) { if (IsVREnabled() && !postShadersInitialized) {
postShaderChain->Set("PostShader1", "ColorCorrection"); postShaderChain->Set("PostShader1", "ColorCorrection");
postShaderSetting->Set("ColorCorrectionSettingValue1",1.0f); postShaderSetting->Set("ColorCorrectionSettingCurrentValue1", 1.0f);
postShaderSetting->Set("ColorCorrectionSettingValue2",1.5f); postShaderSetting->Set("ColorCorrectionSettingCurrentValue2", 1.5f);
postShaderSetting->Set("ColorCorrectionSettingValue3",1.1f); postShaderSetting->Set("ColorCorrectionSettingCurrentValue3", 1.1f);
postShaderSetting->Set("ColorCorrectionSettingValue4",1.0f); postShaderSetting->Set("ColorCorrectionSettingCurrentValue4", 1.0f);
} }
// Load post process shader values // Load post process shader values
+5 -5
View File
@@ -962,7 +962,7 @@ void CWCheatEngine::ExecuteOp(const CheatOperation &op, const CheatCode &cheat,
auto shaderChain = GetFullPostShadersChain(g_Config.vPostShaderNames); auto shaderChain = GetFullPostShadersChain(g_Config.vPostShaderNames);
if (op.PostShaderUniform.shader < shaderChain.size()) { if (op.PostShaderUniform.shader < shaderChain.size()) {
std::string shaderName = shaderChain[op.PostShaderUniform.shader]->section; std::string shaderName = shaderChain[op.PostShaderUniform.shader]->section;
g_Config.mPostShaderSetting[StringFromFormat("%sSettingValue%d", shaderName.c_str(), op.PostShaderUniform.uniform + 1)] = op.PostShaderUniform.value.f; g_Config.mPostShaderSetting[StringFromFormat("%sSettingCurrentValue%d", shaderName.c_str(), op.PostShaderUniform.uniform + 1)] = op.PostShaderUniform.value.f;
} }
} }
break; break;
@@ -979,16 +979,16 @@ void CWCheatEngine::ExecuteOp(const CheatOperation &op, const CheatCode &cheat,
std::string shaderName = shaderChain[op.PostShaderUniform.shader]->section; std::string shaderName = shaderChain[op.PostShaderUniform.shader]->section;
switch (op.PostShaderUniform.format) { switch (op.PostShaderUniform.format) {
case 0: case 0:
g_Config.mPostShaderSetting[StringFromFormat("%sSettingValue%d", shaderName.c_str(), op.PostShaderUniform.uniform + 1)] = value.u & 0x000000FF; g_Config.mPostShaderSetting[StringFromFormat("%sSettingCurrentValue%d", shaderName.c_str(), op.PostShaderUniform.uniform + 1)] = value.u & 0x000000FF;
break; break;
case 1: case 1:
g_Config.mPostShaderSetting[StringFromFormat("%sSettingValue%d", shaderName.c_str(), op.PostShaderUniform.uniform + 1)] = value.u & 0x0000FFFF; g_Config.mPostShaderSetting[StringFromFormat("%sSettingCurrentValue%d", shaderName.c_str(), op.PostShaderUniform.uniform + 1)] = value.u & 0x0000FFFF;
break; break;
case 2: case 2:
g_Config.mPostShaderSetting[StringFromFormat("%sSettingValue%d", shaderName.c_str(), op.PostShaderUniform.uniform + 1)] = value.u; g_Config.mPostShaderSetting[StringFromFormat("%sSettingCurrentValue%d", shaderName.c_str(), op.PostShaderUniform.uniform + 1)] = value.u;
break; break;
case 3: case 3:
g_Config.mPostShaderSetting[StringFromFormat("%sSettingValue%d", shaderName.c_str(), op.PostShaderUniform.uniform + 1)] = value.f; g_Config.mPostShaderSetting[StringFromFormat("%sSettingCurrentValue%d", shaderName.c_str(), op.PostShaderUniform.uniform + 1)] = value.f;
break; break;
} }
} }
+4 -4
View File
@@ -204,10 +204,10 @@ void PresentationCommon::CalculatePostShaderUniforms(int bufferWidth, int buffer
uniforms->gl_HalfPixel[0] = u_pixel_delta * 0.5f; uniforms->gl_HalfPixel[0] = u_pixel_delta * 0.5f;
uniforms->gl_HalfPixel[1] = v_pixel_delta * 0.5f; uniforms->gl_HalfPixel[1] = v_pixel_delta * 0.5f;
uniforms->setting[0] = GetShaderSettingValue(shaderInfo, 0, "SettingValue1"); uniforms->setting[0] = GetShaderSettingValue(shaderInfo, 0, "SettingCurrentValue1");
uniforms->setting[1] = GetShaderSettingValue(shaderInfo, 1, "SettingValue2"); uniforms->setting[1] = GetShaderSettingValue(shaderInfo, 1, "SettingCurrentValue2");
uniforms->setting[2] = GetShaderSettingValue(shaderInfo, 2, "SettingValue3"); uniforms->setting[2] = GetShaderSettingValue(shaderInfo, 2, "SettingCurrentValue3");
uniforms->setting[3] = GetShaderSettingValue(shaderInfo, 3, "SettingValue4"); uniforms->setting[3] = GetShaderSettingValue(shaderInfo, 3, "SettingCurrentValue4");
} }
static std::string ReadShaderSrc(const Path &filename) { static std::string ReadShaderSrc(const Path &filename) {
+1 -1
View File
@@ -418,7 +418,7 @@ void DisplayLayoutScreen::CreateViews() {
auto &setting = shaderInfo->settings[i]; auto &setting = shaderInfo->settings[i];
if (!setting.name.empty()) { if (!setting.name.empty()) {
// This map lookup will create the setting in the mPostShaderSetting map if it doesn't exist, with a default value of 0.0. // This map lookup will create the setting in the mPostShaderSetting map if it doesn't exist, with a default value of 0.0.
std::string key = StringFromFormat("%sSettingValue%d", shaderInfo->section.c_str(), i + 1); std::string key = StringFromFormat("%sSettingCurrentValue%d", shaderInfo->section.c_str(), i + 1);
bool keyExisted = g_Config.mPostShaderSetting.find(key) != g_Config.mPostShaderSetting.end(); bool keyExisted = g_Config.mPostShaderSetting.find(key) != g_Config.mPostShaderSetting.end();
auto &value = g_Config.mPostShaderSetting[key]; auto &value = g_Config.mPostShaderSetting[key];
if (!keyExisted) if (!keyExisted)
+1 -1
View File
@@ -1817,7 +1817,7 @@ void DeveloperToolsScreen::CreateViews() {
for (size_t i = 0; i < ARRAY_SIZE(shaderInfo->settings); ++i) { for (size_t i = 0; i < ARRAY_SIZE(shaderInfo->settings); ++i) {
auto &setting = shaderInfo->settings[i]; auto &setting = shaderInfo->settings[i];
if (!setting.name.empty()) { if (!setting.name.empty()) {
std::string key = StringFromFormat("%sSettingValue%d", shaderInfo->section.c_str(), i + 1); std::string key = StringFromFormat("%sSettingCurrentValue%d", shaderInfo->section.c_str(), i + 1);
bool keyExisted = g_Config.mPostShaderSetting.find(key) != g_Config.mPostShaderSetting.end(); bool keyExisted = g_Config.mPostShaderSetting.find(key) != g_Config.mPostShaderSetting.end();
auto &value = g_Config.mPostShaderSetting[key]; auto &value = g_Config.mPostShaderSetting[key];
if (!keyExisted) if (!keyExisted)