【发布时间】:2016-10-24 12:42:56
【问题描述】:
当我设置环境变量 QSG_RENDERER_DEBUG=render 时,我得到以下输出:
Renderer::render() QSGAbstractRenderer(0x383865f8) "rebuild: none"
Rendering:
-> Opaque: 38 nodes in 2 batches...
-> Alpha: 34 nodes in 13 batches...
- 0x3836a830 [retained] [noclip] [opaque] [ merged] Nodes: 14 Vertices: 88 Indices: 124 root: 0x0
- 0x3836a7f0 [ upload] [noclip] [opaque] [ merged] Nodes: 24 Vertices: 96 Indices: 144 root: 0x0
- 0x3836a8f0 [retained] [noclip] [ alpha] [unmerged] Nodes: 1 Vertices: 48 Indices: 74 root: 0x0
- 0x3836a870 [retained] [noclip] [ alpha] [unmerged] Nodes: 3 Vertices: 52 Indices: 78 root: 0x0
- 0x3836a8b0 [retained] [noclip] [ alpha] [unmerged] Nodes: 6 Vertices: 400 Indices: 720 root: 0x0
- 0x3836a530 [retained] [noclip] [ alpha] [unmerged] Nodes: 4 Vertices: 56 Indices: 84 root: 0x0
- 0x3836a570 [retained] [noclip] [ alpha] [ merged] Nodes: 1 Vertices: 4 Indices: 6 root: 0x0 opacity: 1
- 0x3836a5b0 [retained] [noclip] [ alpha] [unmerged] Nodes: 7 Vertices: 720 Indices: 1302 root: 0x0
- 0x3836a630 [retained] [noclip] [ alpha] [unmerged] Nodes: 3 Vertices: 28 Indices: 42 root: 0x0
- 0x3836a5f0 [retained] [noclip] [ alpha] [ merged] Nodes: 3 Vertices: 12 Indices: 18 root: 0x0 opacity: 1
- 0x3836a6f0 [retained] [noclip] [ alpha] [ merged] Nodes: 1 Vertices: 4 Indices: 6 root: 0x0 opacity: 1
- 0x3836a670 [retained] [noclip] [ alpha] [ merged] Nodes: 1 Vertices: 4 Indices: 6 root: 0x0 opacity: 1
- 0x3836a6b0 [retained] [noclip] [ alpha] [ merged] Nodes: 1 Vertices: 4 Indices: 6 root: 0x0 opacity: 1
- 0x3836a330 [retained] [noclip] [ alpha] [unmerged] Nodes: 2 Vertices: 24 Indices: 36 root: 0x0
- 0x3836a370 [retained] [noclip] [ alpha] [ merged] Nodes: 1 Vertices: 4 Indices: 6 root: 0x0 opacity: 1
-> times: build: 0, prepare(opaque/alpha): 0/0, sorting: 0, upload(opaque/alpha): 0/0, render: 1
如果我想在低性能设备(例如旧 Raspberry PI)上运行它,我认为这是灾难性的。
但是我无法找到以下问题的答案:对此有何意义?我该如何改进它,以减少批次数量,尤其是 Alpha 批次?
我只有几个带有opacity != 0 的对象 (2),并且在此输出时,所有对象都已设置为不可见。
我有两个 SVG(每个 8 个节点)可能会显示在那里。
我不使用任何不适合'#------ff' 格式的颜色(除非我使用的一些 svg 颜色可能设置了 alpha 通道)并且不使用颜色'transparent'
我确实有一个对象,它由两个不透明颜色的“同心”Rectangles 组成,在可视化 overdraw 时标记为 unmerged,我没有线索,为什么。我认为,至少它可以与不相交的兄弟姐妹合并。 他们为什么不呢?
我认为如果我可以识别对象可能会有所帮助,但是当我输出任何可见对象的地址时,(Component.onCompleted: console.log(this)) 我没有得到任何列出的地址。
如何我可以实现渲染对象和我的 QML 对象之间的映射吗?
而且 - 所有这些列表条目到底意味着什么?
编辑:看来,我使用了一些启用了 alpha 的 PNG。将它们替换为 JPG 将消息减少到此。但这些只是节点/批次中的 5 个。 34 去...
-> Opaque: 43 nodes in 6 batches...
-> Alpha: 29 nodes in 8 batches...
问候和感谢,
-m-
【问题讨论】: