Fix/dfm optimize@9#758
Merged
Merged
Conversation
makabaka11
marked this pull request as draft
July 18, 2026 15:14
makabaka11
marked this pull request as ready for review
July 18, 2026 17:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test
Related Issues
Issue Analysis
DFM+ 弹幕引擎(Rust 计算 + GPU 渲染 + Dart overlay)存在偶发跳帧(弹幕"一瞬间卡一下"),iPad Pro 100-120fps 不稳,Android 40-60fps 且掉帧感明显。
根因:新字符 MSDF 光栅化在渲染线程同步阻塞(entry_for cache miss -> rasterize_and_upload -> 等 worker,单 worker 串行 5-50ms/字符),新弹幕含未见字符时整条管线停顿。
核心方案:异步预热 + 同步兜底
思路:在字符进入屏幕前就异步光栅化好填入 atlas;显示时 entry_for 命中 cache,不阻塞。极端情况(预热未覆盖)保留同步兜底(阻塞等但字符照常显示,不返回 None、不跳过字符,避免闪烁)。
What Changed
Rust 侧
rust/src/next2_engine/engine/rendering.rsrust/src/next2_engine/engine/runtime.rsrust/src/next2_engine/engine/renderer_core.rsrust/src/next2_engine/engine/frame.rsDart 侧
lib/danmaku_next/next2_emoji_pipeline.dartlib/danmaku_dfm/dfm_plus_layout_bridge.dartlib/danmaku_dfm/dfm_plus_overlay.dartAndroid 原生
android/app/src/main/kotlin/com/aimessoft/nipaplay/MainActivity.kt