架构微调

This commit is contained in:
2026-08-11 10:01:17 +08:00
parent 996e6f6154
commit 37bb77d280
13 changed files with 258 additions and 45 deletions
+19 -1
View File
@@ -166,7 +166,7 @@ std::string limit_state_name(bool available, std::uint32_t state) {
if (!available)
return "not_applicable";
static constexpr const char* names[]{"frequency_limited", "paint_limited", "render_limited",
"consumer_limited"};
"consumer_limited", "unlimited"};
return state < std::size(names) ? names[state] : "unknown";
}
@@ -460,12 +460,25 @@ void Plot_Core::set_max_render_fps(double fps) {
notify_model_dirty();
}
void Plot_Core::clear_max_render_fps() {
if (impl_->mode != Frame_Control_Mode::Low_Latency)
throw std::logic_error("maximum render FPS is only available in low-latency mode");
std::get<std::unique_ptr<Low_Latency_Plot_Scene>>(impl_->scene)->frame_control.clear_frequency_limit();
notify_model_dirty();
}
void Plot_Core::set_consumer_feedback(Frame_Consumer_Feedback feedback) {
if (impl_->mode != Frame_Control_Mode::Low_Latency)
throw std::logic_error("consumer feedback is only available in low-latency mode");
std::get<std::unique_ptr<Low_Latency_Plot_Scene>>(impl_->scene)->frame_control.set_consumer_feedback(feedback);
}
void Plot_Core::clear_consumer_feedback() {
if (impl_->mode != Frame_Control_Mode::Low_Latency)
throw std::logic_error("consumer feedback is only available in low-latency mode");
std::get<std::unique_ptr<Low_Latency_Plot_Scene>>(impl_->scene)->frame_control.clear_consumer_feedback();
}
double Plot_Core::max_render_fps() const noexcept {
if (impl_->mode != Frame_Control_Mode::Low_Latency)
return std::numeric_limits<double>::quiet_NaN();
@@ -527,7 +540,12 @@ Frame_Observer_Snapshot Plot_Core::frame_observer_snapshot() const {
snapshot.paint_duration_ns = state.paint_duration_ns;
snapshot.render_duration_ns = state.render_duration_ns;
snapshot.target_interval_ns = state.target_interval_ns;
snapshot.frequency_limit_enabled = state.frequency_limit_enabled;
snapshot.consumer_feedback_enabled = state.consumer_feedback_enabled;
snapshot.bottleneck_duration_ns = state.bottleneck_duration_ns;
snapshot.consumer_sample_interval_ns = state.consumer_sample_interval_ns;
snapshot.consumer_smoothed_interval_ns = state.consumer_smoothed_interval_ns;
snapshot.consumer_variation_ns = state.consumer_variation_ns;
snapshot.consumer_interval_ns = state.consumer_interval_ns;
snapshot.next_refresh_interval_ns = state.next_refresh_interval_ns;
snapshot.end_to_end_ns = state.end_to_end_ns;
+7
View File
@@ -50,7 +50,12 @@ struct Frame_Observer_Snapshot {
std::uint64_t paint_duration_ns{};
std::uint64_t render_duration_ns{};
std::uint64_t target_interval_ns{};
bool frequency_limit_enabled{};
bool consumer_feedback_enabled{};
std::uint64_t bottleneck_duration_ns{};
std::uint64_t consumer_sample_interval_ns{};
std::uint64_t consumer_smoothed_interval_ns{};
std::uint64_t consumer_variation_ns{};
std::uint64_t consumer_interval_ns{};
std::uint64_t next_refresh_interval_ns{};
std::uint64_t paint_lease_wait_ns{};
@@ -114,7 +119,9 @@ public:
[[nodiscard]] bool view_active() const noexcept;
void set_max_render_fps(double fps);
void clear_max_render_fps();
void set_consumer_feedback(Frame_Consumer_Feedback feedback);
void clear_consumer_feedback();
[[nodiscard]] double max_render_fps() const noexcept;
[[nodiscard]] Low_Latency_Diagnostics diagnostics() const;
[[nodiscard]] Refresh_Control_Snapshot refresh_feedback_snapshot() const;