【问题标题】:What to make out of the output of QSG_RENDERER_DEBUG=render从 QSG_RENDERER_DEBUG=render 的输出中得到什么
【发布时间】: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-

【问题讨论】:

    标签: qml render qtquick2


    【解决方案1】:

    来自doc.qt.io:“[一批] 是为每组独特的材料状态和几何类型创建的”。减少差异数量,默认渲染器将兼容的 OpenGL 图元放入同一个批次中。

    例如:

    • 具有不同width/height/color/gradient/rotation属性的矩形元素被批处理在一起,但不同opacity/radius/antialiasing属性不.

    • 使用十六进制三元组将color 属性设置为不透明值的矩形元素(例如:使用'#228B22''#282' 指定'forestgreen')一起批处理。但是指定半透明颜色(不以 '#FF' 开头的十六进制四边形,例如:'#44228B22' -- 25% 不透明 'forestgreen')会强制单独批处理 即使半透明颜色值相同 em>(在 Qt 5.9.1 上验证)。具有半透明border 颜色也会强制分开批次即使半透明颜色值相同

    • 具有不同fontletterspacing/underline的文本元素 属性分组在一起,但不同的font bold/italic/pixelSize/hintingPreference 属性是分开的。

    您可以通过更改可见属性并查看出现或消失的内容来确定哪些对象是哪些。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-27
      • 1970-01-01
      • 2012-04-26
      • 2017-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-08
      相关资源
      最近更新 更多