mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-03 19:18:09 +00:00
Queues and refresh rate adjustments
This commit is contained in:
@@ -380,6 +380,43 @@ void UpdateRescalingInfo() {
|
||||
TranslateResolutionInfo(setup, info);
|
||||
}
|
||||
|
||||
u32 FrameGenMultiplierCeiling() {
|
||||
const u32 configured = values.frame_gen_multiplier.GetValue();
|
||||
if (configured == AUTO_FRAME_GEN_MULTIPLIER) {
|
||||
return MAX_FRAME_GEN_MULTIPLIER;
|
||||
}
|
||||
return std::clamp(configured, MIN_FRAME_GEN_MULTIPLIER, MAX_FRAME_GEN_MULTIPLIER);
|
||||
}
|
||||
|
||||
u32 FrameGenMultiplier() {
|
||||
const u32 ceiling = FrameGenMultiplierCeiling();
|
||||
|
||||
const float refresh = values.display_refresh_rate;
|
||||
if (refresh <= 1.0f) {
|
||||
return ceiling;
|
||||
}
|
||||
|
||||
constexpr float UNMEASURED_GUEST_FRAME_RATE = 60.0f;
|
||||
float base = values.guest_frame_rate > 1.0f ? values.guest_frame_rate
|
||||
: UNMEASURED_GUEST_FRAME_RATE;
|
||||
if (values.use_speed_limit.GetValue()) {
|
||||
const u16 limit = std::min<u16>(SpeedLimit(), 100);
|
||||
if (limit > 0) {
|
||||
base *= static_cast<float>(limit) / 100.0f;
|
||||
}
|
||||
}
|
||||
|
||||
const u32 presentable = static_cast<u32>(refresh / std::max(base, 1.0f));
|
||||
return std::min(ceiling, std::max(presentable, 1u));
|
||||
}
|
||||
|
||||
size_t FrameGenGenerations() {
|
||||
if (!values.frame_gen.GetValue()) {
|
||||
return 0;
|
||||
}
|
||||
return FrameGenMultiplier() - 1;
|
||||
}
|
||||
|
||||
void RestoreGlobalState(bool is_powered_on) {
|
||||
// If a game is running, DO NOT restore the global settings state
|
||||
if (is_powered_on) {
|
||||
|
||||
+27
-2
@@ -392,8 +392,8 @@ struct Values {
|
||||
Specialization::Default, true, false};
|
||||
|
||||
SwitchableSetting<u32, true> frame_gen_multiplier{linkage,
|
||||
2,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
4,
|
||||
"frame_gen_multiplier",
|
||||
Category::Renderer,
|
||||
@@ -414,6 +414,17 @@ struct Values {
|
||||
true,
|
||||
&frame_gen};
|
||||
|
||||
SwitchableSetting<u32, true> frame_gen_queue_target{linkage,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
"frame_gen_queue_target",
|
||||
Category::Renderer,
|
||||
Specialization::Countable,
|
||||
true,
|
||||
false,
|
||||
&frame_gen};
|
||||
|
||||
SwitchableSetting<bool> frame_gen_fp16{linkage, true, "frame_gen_fp16", Category::Renderer,
|
||||
Specialization::Default, true, false, &frame_gen};
|
||||
|
||||
@@ -902,10 +913,24 @@ struct Values {
|
||||
|
||||
// Per-game overrides
|
||||
bool use_squashed_iterated_blend;
|
||||
|
||||
// Rates published by the frontend, in hertz. Zero means not measured yet.
|
||||
float display_refresh_rate;
|
||||
float guest_frame_rate;
|
||||
};
|
||||
|
||||
extern Values values;
|
||||
|
||||
constexpr u32 AUTO_FRAME_GEN_MULTIPLIER = 0;
|
||||
constexpr u32 MIN_FRAME_GEN_MULTIPLIER = 2;
|
||||
constexpr u32 MAX_FRAME_GEN_MULTIPLIER = 4;
|
||||
|
||||
[[nodiscard]] u32 FrameGenMultiplierCeiling();
|
||||
|
||||
[[nodiscard]] u32 FrameGenMultiplier();
|
||||
|
||||
[[nodiscard]] size_t FrameGenGenerations();
|
||||
|
||||
bool getDebugKnobAt(u8 i);
|
||||
|
||||
void UpdateGPUAccuracy();
|
||||
|
||||
Reference in New Issue
Block a user