升级
This commit is contained in:
@@ -496,8 +496,10 @@ Scene_Edit_Error Scene_Base::Renderable_Editor::clear_dependency_parent(
|
||||
}
|
||||
void Scene_Base::Renderable_Editor::replace_frame_control_strategy(
|
||||
std::shared_ptr<Frame_Control_Strategy_Base> strategy) {
|
||||
scene_.d_func().frame_control().replace_frame_control_strategy(
|
||||
auto& implementation = scene_.d_func();
|
||||
implementation.frame_control().replace_frame_control_strategy(
|
||||
std::move(strategy));
|
||||
implementation.refresh_interval_reset_pending_ = true;
|
||||
}
|
||||
Scene_Edit_Error Scene_Base::Edit_Operation::wait() const {
|
||||
if (!result_.valid()) ::renderive::error::unexpected<std::logic_error>("scene edit operation is invalid");
|
||||
@@ -679,8 +681,11 @@ Scene_Render_Result Scene_Base::Impl::submit_render(Abstract_Frame* frame) {
|
||||
? frame->state_->published_snapshot.exchange({}, std::memory_order_acq_rel)
|
||||
: nullptr;
|
||||
if (!snapshot) snapshot = capture_live_frame();
|
||||
snapshot->next_refresh_interval_ns_ =
|
||||
strategy->next_refresh_interval_ns();
|
||||
// Strategy replacement is a refresh-timing boundary. The snapshot interval defaults
|
||||
// to 0, so a boundary frame that may have been published by the previous strategy
|
||||
// cannot inherit runtime cadence across the switch; later submissions use the current strategy.
|
||||
if (std::exchange(refresh_interval_reset_pending_, false)) snapshot->next_refresh_interval_ns_ = {};
|
||||
else snapshot->next_refresh_interval_ns_ = strategy->next_refresh_interval_ns();
|
||||
if (render_sequence_ == std::numeric_limits<std::uint64_t>::max()) ::renderive::error::unexpected<std::overflow_error>("render sequence exhausted");
|
||||
snapshot->render_sequence = ++render_sequence_;
|
||||
auto task = std::make_shared<Render_Task>();
|
||||
|
||||
@@ -143,6 +143,7 @@ public:
|
||||
std::shared_ptr<Render_Completion> current_completion_;
|
||||
std::exception_ptr pending_exception_;
|
||||
std::size_t deferred_render_count_{};
|
||||
bool refresh_interval_reset_pending_{};
|
||||
std::uint64_t render_sequence_{};
|
||||
std::size_t pending_operations_{};
|
||||
bool runtime_started_{};
|
||||
|
||||
Reference in New Issue
Block a user