mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-02 23:42:43 +00:00
RCAS under graphics tab
This commit is contained in:
parent
5691046dcc
commit
b109499cb5
@ -40,6 +40,7 @@ static u32 screenWidth = 1280;
|
||||
static u32 screenHeight = 720;
|
||||
static s32 gpuId = -1; // Vulkan physical device index. Set to negative for auto select
|
||||
static std::string logFilter;
|
||||
static float rcas_attenuation = 0.25f;
|
||||
static std::string logType = "async";
|
||||
static std::string userName = "shadPS4";
|
||||
static std::string updateChannel;
|
||||
@ -214,6 +215,14 @@ s32 getGpuId() {
|
||||
return gpuId;
|
||||
}
|
||||
|
||||
float getRcasAttenuation() {
|
||||
return rcas_attenuation;
|
||||
}
|
||||
|
||||
void setRcasAttenuation(float value) {
|
||||
rcas_attenuation = value;
|
||||
}
|
||||
|
||||
std::string getLogFilter() {
|
||||
return logFilter;
|
||||
}
|
||||
@ -763,6 +772,7 @@ void load(const std::filesystem::path& path) {
|
||||
|
||||
screenWidth = toml::find_or<int>(gpu, "screenWidth", screenWidth);
|
||||
screenHeight = toml::find_or<int>(gpu, "screenHeight", screenHeight);
|
||||
rcas_attenuation = toml::find_or<float>(gpu, "rcas_attenuation", 0.25f);
|
||||
isNullGpu = toml::find_or<bool>(gpu, "nullGpu", false);
|
||||
shouldCopyGPUBuffers = toml::find_or<bool>(gpu, "copyGPUBuffers", false);
|
||||
shouldDumpShaders = toml::find_or<bool>(gpu, "dumpShaders", false);
|
||||
@ -902,6 +912,7 @@ void save(const std::filesystem::path& path) {
|
||||
data["Input"]["useUnifiedInputConfig"] = useUnifiedInputConfig;
|
||||
data["GPU"]["screenWidth"] = screenWidth;
|
||||
data["GPU"]["screenHeight"] = screenHeight;
|
||||
data["GPU"]["rcas_attenuation"] = rcas_attenuation;
|
||||
data["GPU"]["nullGpu"] = isNullGpu;
|
||||
data["GPU"]["copyGPUBuffers"] = shouldCopyGPUBuffers;
|
||||
data["GPU"]["dumpShaders"] = shouldDumpShaders;
|
||||
|
@ -15,6 +15,8 @@ void load(const std::filesystem::path& path);
|
||||
void save(const std::filesystem::path& path);
|
||||
void saveMainWindow(const std::filesystem::path& path);
|
||||
|
||||
float getRcasAttenuation();
|
||||
void setRcasAttenuation(float value);
|
||||
std::string getTrophyKey();
|
||||
void setTrophyKey(std::string key);
|
||||
bool GetLoadGameSizeEnabled();
|
||||
|
@ -485,6 +485,9 @@ void SettingsDialog::LoadValuesFromConfig() {
|
||||
ui->checkCompatibilityOnStartupCheckBox->setChecked(
|
||||
toml::find_or<bool>(data, "General", "checkCompatibilityOnStartup", false));
|
||||
|
||||
ui->rcasAttenuationSlider->setValue(static_cast<int>(Config::getRcasAttenuation() * 1000));
|
||||
ui->rcasAttenuationSpinBox->setValue(Config::getRcasAttenuation());
|
||||
|
||||
#ifdef ENABLE_UPDATER
|
||||
ui->updateCheckBox->setChecked(toml::find_or<bool>(data, "General", "autoUpdate", false));
|
||||
ui->changelogCheckBox->setChecked(
|
||||
@ -782,6 +785,7 @@ void SettingsDialog::UpdateSettings() {
|
||||
Config::setBackgroundImageOpacity(ui->backgroundImageOpacitySlider->value());
|
||||
emit BackgroundOpacityChanged(ui->backgroundImageOpacitySlider->value());
|
||||
Config::setShowBackgroundImage(ui->showBackgroundImageCheckBox->isChecked());
|
||||
Config::setRcasAttenuation(ui->rcasAttenuationSpinBox->value());
|
||||
|
||||
#ifdef ENABLE_DISCORD_RPC
|
||||
auto* rpc = Common::Singleton<DiscordRPCHandler::RPC>::Instance();
|
||||
@ -796,6 +800,18 @@ void SettingsDialog::UpdateSettings() {
|
||||
BackgroundMusicPlayer::getInstance().setVolume(ui->BGMVolumeSlider->value());
|
||||
}
|
||||
|
||||
void SettingsDialog::OnRcasAttenuationChanged(int value) {
|
||||
float attenuation = static_cast<float>(value) / 1000.0f;
|
||||
ui->rcasAttenuationSpinBox->setValue(attenuation);
|
||||
Config::setRcasAttenuation(attenuation);
|
||||
}
|
||||
|
||||
void SettingsDialog::OnRcasAttenuationSpinBoxChanged(double value) {
|
||||
int int_value = static_cast<int>(value * 1000);
|
||||
ui->rcasAttenuationSlider->setValue(int_value);
|
||||
Config::setRcasAttenuation(static_cast<float>(value));
|
||||
}
|
||||
|
||||
void SettingsDialog::ResetInstallFolders() {
|
||||
|
||||
std::filesystem::path userdir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
||||
|
@ -43,6 +43,8 @@ private:
|
||||
void OnLanguageChanged(int index);
|
||||
void OnCursorStateChanged(s16 index);
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
void OnRcasAttenuationChanged(int value);
|
||||
void OnRcasAttenuationSpinBoxChanged(double value);
|
||||
|
||||
std::unique_ptr<Ui::SettingsDialog> ui;
|
||||
|
||||
|
@ -1127,6 +1127,48 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="rcasAttenuationLabel">
|
||||
<property name="text">
|
||||
<string>RCAS Attenuation</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="rcasAttenuationSlider">
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>3000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="tickInterval">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="rcasAttenuationSpinBox">
|
||||
<property name="minimum">
|
||||
<double>0.000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>3.000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.001</double>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
@ -273,7 +273,7 @@ vk::ImageView FsrPass::Render(vk::CommandBuffer cmdbuf, vk::ImageView input,
|
||||
|
||||
{ // rcas
|
||||
consts = {};
|
||||
FsrRcasCon(reinterpret_cast<AU1*>(&consts.Const0), settings.rcas_attenuation);
|
||||
FsrRcasCon(reinterpret_cast<AU1*>(&consts.Const0), Config::getRcasAttenuation());
|
||||
consts.Sample[0] = hdr ? 1 : 0;
|
||||
|
||||
std::array<vk::DescriptorImageInfo, 3> img_info{{
|
||||
|
@ -4,6 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
#include "common/config.h"
|
||||
#include "video_core/renderer_vulkan/vk_common.h"
|
||||
#include "video_core/texture_cache/image.h"
|
||||
|
||||
@ -14,7 +15,7 @@ public:
|
||||
struct Settings {
|
||||
bool enable{true};
|
||||
bool use_rcas{true};
|
||||
float rcas_attenuation{0.25f};
|
||||
float rcas_attenuation{Config::getRcasAttenuation()};
|
||||
};
|
||||
|
||||
void Create(vk::Device device, VmaAllocator allocator, u32 num_images);
|
||||
|
Loading…
Reference in New Issue
Block a user