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:
parent
dbbe5b3328
commit
f2a7c1317f
2 changed files with 11 additions and 2 deletions
|
@ -322,9 +322,9 @@ struct Values {
|
||||||
SwitchableSetting<int> vulkan_device{linkage, 0, "vulkan_device", Category::Renderer,
|
SwitchableSetting<int> vulkan_device{linkage, 0, "vulkan_device", Category::Renderer,
|
||||||
Specialization::RuntimeList};
|
Specialization::RuntimeList};
|
||||||
SwitchableSetting<bool> enable_raii{linkage, false, "enable_raii", Category::Renderer};
|
SwitchableSetting<bool> enable_raii{linkage, false, "enable_raii", Category::Renderer};
|
||||||
#ifdef __ANDROID__
|
|
||||||
SwitchableSetting<bool> frame_interpolation{linkage, true, "frame_interpolation", Category::Renderer,
|
SwitchableSetting<bool> frame_interpolation{linkage, true, "frame_interpolation", Category::Renderer,
|
||||||
Specialization::RuntimeList};
|
Specialization::RuntimeList};
|
||||||
|
#ifdef __ANDROID__
|
||||||
SwitchableSetting<bool> frame_skipping{linkage, false, "frame_skipping", Category::Renderer,
|
SwitchableSetting<bool> frame_skipping{linkage, false, "frame_skipping", Category::Renderer,
|
||||||
Specialization::RuntimeList};
|
Specialization::RuntimeList};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -37,6 +37,7 @@ static void RunThread(std::stop_token stop_token, Core::System& system,
|
||||||
VideoCore::RasterizerInterface* const rasterizer = renderer.ReadRasterizer();
|
VideoCore::RasterizerInterface* const rasterizer = renderer.ReadRasterizer();
|
||||||
|
|
||||||
CommandDataContainer next;
|
CommandDataContainer next;
|
||||||
|
size_t frame_counter = 0;
|
||||||
|
|
||||||
while (!stop_token.stop_requested()) {
|
while (!stop_token.stop_requested()) {
|
||||||
state.queue.PopWait(next, stop_token);
|
state.queue.PopWait(next, stop_token);
|
||||||
|
@ -44,7 +45,15 @@ static void RunThread(std::stop_token stop_token, Core::System& system,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (auto* submit_list = std::get_if<SubmitListCommand>(&next.data)) {
|
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)) {
|
} else if (std::holds_alternative<GPUTickCommand>(next.data)) {
|
||||||
system.GPU().TickWork();
|
system.GPU().TickWork();
|
||||||
} else if (const auto* flush = std::get_if<FlushRegionCommand>(&next.data)) {
|
} else if (const auto* flush = std::get_if<FlushRegionCommand>(&next.data)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue