Fixed suggestions and clang.

This commit is contained in:
Dmugetsu 2025-03-18 05:50:52 -06:00
parent 652de1db51
commit c8b71918ce
3 changed files with 12 additions and 4 deletions

View File

@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "common/config.h"
#include "layer.h" #include "layer.h"
#include <imgui.h> #include <imgui.h>
@ -94,7 +95,10 @@ void L::DrawMenuBar() {
Checkbox("RCAS", &fsr.use_rcas); Checkbox("RCAS", &fsr.use_rcas);
BeginDisabled(!fsr.use_rcas); BeginDisabled(!fsr.use_rcas);
{ {
SliderFloat("RCAS Attenuation", &fsr.rcas_attenuation, 0.0, 3.0); float attenuation = Config::getRcasAttenuation();
if (SliderFloat("RCAS Attenuation", &attenuation, 0.0, 3.0)) {
Config::setRcasAttenuation(attenuation);
}
} }
EndDisabled(); EndDisabled();
} }
@ -309,6 +313,10 @@ static void LoadSettings(const char* line) {
dump_frame_count = i; dump_frame_count = i;
return; return;
} }
if (sscanf(line, "rcas_attenuation=%f", &f) == 1) {
Config::setRcasAttenuation(f);
return;
}
} }
void L::SetupSettings() { void L::SetupSettings() {
@ -418,4 +426,4 @@ void L::Draw() {
} }
PopID(); PopID();
} }

View File

@ -273,7 +273,7 @@ vk::ImageView FsrPass::Render(vk::CommandBuffer cmdbuf, vk::ImageView input,
{ // rcas { // rcas
consts = {}; consts = {};
FsrRcasCon(reinterpret_cast<AU1*>(&consts.Const0), Config::getRcasAttenuation()); FsrRcasCon(reinterpret_cast<AU1*>(&consts.Const0), settings.rcas_attenuation);
consts.Sample[0] = hdr ? 1 : 0; consts.Sample[0] = hdr ? 1 : 0;
std::array<vk::DescriptorImageInfo, 3> img_info{{ std::array<vk::DescriptorImageInfo, 3> img_info{{

View File

@ -15,7 +15,7 @@ public:
struct Settings { struct Settings {
bool enable{true}; bool enable{true};
bool use_rcas{true}; bool use_rcas{true};
float rcas_attenuation{Config::getRcasAttenuation()}; float rcas_attenuation{0.25f};
}; };
void Create(vk::Device device, VmaAllocator allocator, u32 num_images); void Create(vk::Device device, VmaAllocator allocator, u32 num_images);