feat: vendor QSGBatchRenderer as WSGBatchRenderer - #1275
Conversation
There was a problem hiding this comment.
Sorry @zccrs, your pull request is larger than the review limit of 150000 diff characters
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zccrs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideVendors Qt Quick’s QSGBatchRenderer into waylib as WSGBatchRenderer, wires it through a custom scene graph context (WSGContext) so QQuickRenderControl and window renderers use the fork, and updates the existing buffer/render paths to depend on WSGBatchRenderer while preserving the software backend and adding version/ABI guards. Sequence diagram for installing WSGContext before QQuickRenderControl creationsequenceDiagram
actor App
participant WOutputRenderWindow
participant WSGContext
participant QQuickRenderControlPrivate
participant WSGRenderContext
participant WSGBatchRenderer_Renderer
App->>WOutputRenderWindow: constructor
WOutputRenderWindow->>WSGContext: ensureInstalled()
WSGContext->>QQuickRenderControlPrivate: check sg
alt sg is null or QSGDefaultContext
WSGContext->>QQuickRenderControlPrivate: sg = new WSGDefaultContext
else sg is nondefault
WSGContext-->>QQuickRenderControlPrivate: keep existing sg
end
WOutputRenderWindow->>WOutputRenderWindow: createOutputRenderControl()
WOutputRenderWindow->>QQuickRenderControlPrivate: new RenderControl()
QQuickRenderControlPrivate->>WSGRenderContext: createRenderContext()
WSGRenderContext->>WSGBatchRenderer_Renderer: createRenderer(RenderMode2D)
WSGBatchRenderer_Renderer-->>WSGRenderContext: Renderer instance
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
1e310ab to
b53de02
Compare
|
TAG Bot New tag: 0.8.18 |
2815e84 to
f91d626
Compare
|
大佬今天能合入嘛( |
今天肯定不行,本月能合入就不错了。 |
7c799c8 to
76f4495
Compare
|
大佬, 这个跑分
个人认为体现的作用不大, 因为它超出了实际显示器的极限帧率太多, 以至于性能瓶颈几乎不在GPU上, 这边建议跑毒蘑菇这样榨干显卡的, 预设设置为高即可: https://www.volumeshader.dev/zh-CN/gpu-test |
76f4495 to
1c30c5a
Compare
1. Vendor qtdeclarative v6.11.1 QSGBatchRenderer/QSGRhiVisualizer into waylib as WSGBatchRenderer, version-gated for Qt 6.8-6.12. 2. Install WSGContext as QQuickRenderControlPrivate::sg before any QQuickRenderControl so RHI createRenderer() returns the fork. 3. Route extra sources and WRenderBufferNode through createRenderer(); keep the software backend on Qt's own scene graph adaptation. Log: RHI path uses a vendored Scene Graph batch renderer. No user-facing changes yet; damage tracking is not in this step. Influence: 1. Launch tinywl-qtquick on the default RHI backend and verify windows, titlebar, lockscreen, overview, Blur/Glass still render. 2. Run with QT_QUICK_BACKEND=software and confirm the software path is unchanged and RenderControl creation does not crash. 3. Confirm that creating a QQuickRenderControl before WOutputRenderWindow fatals with the WSGContext install error. feat: 将 Qt BatchRenderer 以 WSGBatchRenderer 接入 RHI 1. 从 qtdeclarative v6.11.1 引入 QSGBatchRenderer/QSGRhiVisualizer, 命名空间改为 WSGBatchRenderer,并用版本宏兼容 Qt 6.8-6.12。 2. 在任何 QQuickRenderControl 构造前安装 WSGContext 覆盖 sg, 使 RHI 路径的 createRenderer() 直接创建 fork。 3. extra source 与 WRenderBufferNode 改为走 createRenderer(); software 仍使用 Qt 自己的 scene graph adaptation。 Log: RHI 路径改用自带的 Scene Graph batch renderer。暂无用户可见 变化,本步未做 damage tracking。 Influence: 1. 用默认 RHI 启动 tinywl-qtquick,检查窗口、标题栏、锁屏、多任务、 Blur/Glass 绘制是否正常。 2. 设置 QT_QUICK_BACKEND=software,确认 software 路径不变、不崩溃。 3. 若在 WOutputRenderWindow 之前创建 QQuickRenderControl,应 qFatal。
1c30c5a to
553a89f
Compare
1. Add WSGDamageTracker that unions dirty node AABBs into flushRegion, and WSGDamageNode so surface content damage is not the full quad. 2. Resolve DontCare to Preserve (wlroots LOAD). GLES and Vulkan both redraw ring-stale pixels under per-rect GPU scissors, with no blit. 3. Highlight overlay is red for this frame and shifts to green for older frames; WAYLIB_DEBUG_DAMAGE and the debug menu switch modes. 4. Add tracker, QML scene, and visual overlay tests for GLES and Vulkan. Log: Partial redraw follows Scene Graph damage. Debug highlight can show refresh regions (red current, green older) via WAYLIB_DEBUG_DAMAGE. Influence: 1. Run test_wsgdamage and test_wsgdamage_visual (gles2 and vulkan). 2. Set WAYLIB_DEBUG_DAMAGE=highlight, move a window: this frame is red, fading older rects shift toward green and disappear after 250ms. 3. Use the debug menu Damage entry (Off/Highlight/Log/Rerender) and confirm leftover overlay is erased after switching Off. 4. After a highlight, idle frames should not full-screen flicker. feat: 跟踪场景图 damage 并按区域裁剪 GPU 重绘 1. 新增 WSGDamageTracker,将脏节点 AABB 合并进 flushRegion; WSGDamageNode 让 surface 内容损坏不再整块四边形刷新。 2. DontCare 默认 Preserve(对齐 wlroots LOAD)。GLES 与 Vulkan 都在 按矩形 GPU scissor 下重画 ring 过期像素,不再 copy 上一帧。 3. Highlight 本帧为红、更旧帧过渡到绿;WAYLIB_DEBUG_DAMAGE 与 调试菜单可切换 none/highlight/log/rerender。 4. 增加 tracker、QML 场景和 overlay 像素测试(gles2/vulkan)。 Log: 局部重绘跟随场景图 damage。可通过 WAYLIB_DEBUG_DAMAGE 用 红(本帧)到绿(旧帧)高亮刷新区域。 Influence: 1. 运行 test_wsgdamage 与 test_wsgdamage_visual(gles2 和 vulkan)。 2. 设置 WAYLIB_DEBUG_DAMAGE=highlight,移动窗口:本帧红色, 旧区域变绿并在 250ms 后消失。 3. 用调试菜单 Damage(Off/Highlight/Log/Rerender),确认 Off 后 残留 overlay 被擦掉。 4. highlight 之后的空闲帧不应整屏闪烁。
553a89f to
7f6b59f
Compare
|
我弄了个review, 希望对大佬有帮助(08/19跑的): 08/20跑的: |
|
TAG Bot New tag: 0.9.0 |
Summary
QSGBatchRenderer(qtdeclarative v6.11.1) into waylib asWSGBatchRenderer, with version gates so one copy builds against Qt 6.8.0, 6.11.x and 6.12.x.WSGContextonQQuickRenderControlPrivate::sgbefore anyQQuickRenderControlis constructed, so the RHI window renderer and extra sources come from the fork viacreateRenderer().Test plan
QT_QUICK_BACKEND=software: software path unchanged, no crash on RenderControl creationQQuickRenderControlbeforeWOutputRenderWindowfatals (WSGContext must be installed first)Benchmark
glmark2-es2-wayland, 800×600 windowed, 2s per scene (not the official 10s run). Same GLES client against compositor
WLR_RENDERER=gles2|vulkan.WLR_SCENE_DISABLE_DIRECT_SCANOUT=1. Intel Arc Pro (ARL), Mesa 24.3. Isolated builds under~/tmp/glmark-bench/, no system install.Overall score (higher is better):
Per scene (FPS)
tinywl GLES logged
Atomic commit failed: Device or resource busymid-run; all 31 scenes still recorded.Summary by Sourcery
Vendor and integrate a Waylib scene-graph renderer with end-to-end partial-damage tracking, preserved-buffer rendering, and runtime diagnostics while retaining Qt's software path.
New Features:
Bug Fixes:
Enhancements:
Build:
Documentation:
Tests:
Chores: