Try to implement a frame interpolation / skipping method

First, I need to see if this will act as a interpolation or as frame skip.
This commit is contained in:
Gamer64 2025-08-06 20:01:13 +02:00
parent dbbe5b3328
commit f2a7c1317f
2 changed files with 11 additions and 2 deletions

View file

@ -322,9 +322,9 @@ struct Values {
SwitchableSetting<int> vulkan_device{linkage, 0, "vulkan_device", Category::Renderer,
Specialization::RuntimeList};
SwitchableSetting<bool> enable_raii{linkage, false, "enable_raii", Category::Renderer};
#ifdef __ANDROID__
SwitchableSetting<bool> frame_interpolation{linkage, true, "frame_interpolation", Category::Renderer,
Specialization::RuntimeList};
#ifdef __ANDROID__
SwitchableSetting<bool> frame_skipping{linkage, false, "frame_skipping", Category::Renderer,
Specialization::RuntimeList};
#endif

View file

@ -37,6 +37,7 @@ static void RunThread(std::stop_token stop_token, Core::System& system,
VideoCore::RasterizerInterface* const rasterizer = renderer.ReadRasterizer();
CommandDataContainer next;
size_t frame_counter = 0;
while (!stop_token.stop_requested()) {
state.queue.PopWait(next, stop_token);
@ -44,7 +45,15 @@ static void RunThread(std::stop_token stop_token, Core::System& system,
break;
}
if (auto* submit_list = std::get_if<SubmitListCommand>(&next.data)) {
scheduler.Push(submit_list->channel, std::move(submit_list->entries));
bool skip_frame = false;
if (Settings::values.frame_interpolation.GetValue()) {
// Skip every other frame
skip_frame = (frame_counter % 2 == 1);
frame_counter++;
}
if (!skip_frame) {
scheduler.Push(submit_list->channel, std::move(submit_list->entries));
}
} else if (std::holds_alternative<GPUTickCommand>(next.data)) {
system.GPU().TickWork();
} else if (const auto* flush = std::get_if<FlushRegionCommand>(&next.data)) {