4

我在 Android 上使用 OpenGL ES 2.0 得到一些慢帧。足以使它们在渲染中引起口吃。我已经输入了一些输出到 System.err 这两条信息的行:

  1. 过去 60 帧的平均绘制时间(“平均绘制时间:2”)
  2. 一帧绘制时间超过 10 毫秒,g = GUI 绘制时间,w = 世界绘制时间(“慢帧!!!(29,g=27,w=2)”)

我在这个问题下面发布了一些示例输出,显示随机慢帧。

即使场景中没有任何变化,也会发生这种情况。什么可能导致这些间歇性慢帧?如果我更深入地了解时间,看看是否有任何东西一直在减慢速度,我什么也看不到。这似乎是随机的。垃圾回收在这个示例输出中只发生了两次,所以我认为 GC 不会是问题。还有什么可能导致这些帧不时花费这么长时间?

11-09 13:42:53.768: W/System.err(25924): Avg draw time: 2
11-09 13:42:54.839: W/System.err(25924): Avg draw time: 2
11-09 13:42:55.860: W/System.err(25924): Avg draw time: 2
11-09 13:42:56.881: W/System.err(25924): Avg draw time: 2
11-09 13:42:57.442: D/dalvikvm(25924): GC_CONCURRENT freed 1715K, 62% free 3619K/9379K, paused 1ms+2ms
11-09 13:42:57.912: W/System.err(25924): Avg draw time: 2
11-09 13:42:58.273: W/System.err(25924): Slow frame!!! (29, g=27, w=2)
11-09 13:42:58.924: W/System.err(25924): Avg draw time: 3
11-09 13:42:59.014: W/System.err(25924): Slow frame!!! (19, g=2, w=17)
11-09 13:42:59.955: W/System.err(25924): Avg draw time: 4
11-09 13:43:00.075: W/System.err(25924): Slow frame!!! (28, g=25, w=3)
11-09 13:43:00.445: W/System.err(25924): Slow frame!!! (20, g=9, w=11)
11-09 13:43:01.026: W/System.err(25924): Avg draw time: 4
11-09 13:43:02.037: W/System.err(25924): Avg draw time: 4
11-09 13:43:02.197: W/System.err(25924): Slow frame!!! (16, g=14, w=2)
11-09 13:43:02.227: W/System.err(25924): Slow frame!!! (16, g=4, w=12)
11-09 13:43:03.088: W/System.err(25924): Avg draw time: 5
11-09 13:43:03.218: W/System.err(25924): Slow frame!!! (13, g=8, w=5)
11-09 13:43:03.308: W/System.err(25924): Slow frame!!! (22, g=16, w=6)
11-09 13:43:03.318: W/System.err(25924): Slow frame!!! (14, g=10, w=4)
11-09 13:43:03.348: W/System.err(25924): Slow frame!!! (11, g=8, w=3)
11-09 13:43:04.109: W/System.err(25924): Avg draw time: 4
11-09 13:43:05.030: W/System.err(25924): Slow frame!!! (31, g=29, w=2)
11-09 13:43:05.060: W/System.err(25924): Slow frame!!! (11, g=3, w=8)
11-09 13:43:05.070: W/System.err(25924): Slow frame!!! (15, g=11, w=3)
11-09 13:43:05.150: W/System.err(25924): Avg draw time: 4
11-09 13:43:06.191: W/System.err(25924): Avg draw time: 2
11-09 13:43:07.202: W/System.err(25924): Avg draw time: 1
11-09 13:43:08.243: W/System.err(25924): Avg draw time: 3
11-09 13:43:09.275: W/System.err(25924): Avg draw time: 4
11-09 13:43:09.965: W/System.err(25924): Slow frame!!! (29, g=28, w=1)
11-09 13:43:10.025: D/dalvikvm(25924): GC_CONCURRENT freed 1721K, 62% free 3625K/9379K, paused 3ms+4ms
11-09 13:43:10.296: W/System.err(25924): Avg draw time: 4
11-09 13:43:10.736: W/System.err(25924): Slow frame!!! (14, g=11, w=2)
11-09 13:43:10.756: W/System.err(25924): Slow frame!!! (14, g=3, w=11)
11-09 13:43:10.776: W/System.err(25924): Slow frame!!! (14, g=1, w=13)
11-09 13:43:11.307: W/System.err(25924): Avg draw time: 4
11-09 13:43:11.337: W/System.err(25924): Slow frame!!! (17, g=3, w=14)
11-09 13:43:11.357: W/System.err(25924): Slow frame!!! (14, g=3, w=11)
11-09 13:43:11.387: W/System.err(25924): Slow frame!!! (12, g=2, w=10)
11-09 13:43:11.797: W/System.err(25924): Slow frame!!! (17, g=14, w=3)
11-09 13:43:12.328: W/System.err(25924): Avg draw time: 3
11-09 13:43:13.319: W/System.err(25924): Slow frame!!! (19, g=3, w=16)
11-09 13:43:13.349: W/System.err(25924): Avg draw time: 5
11-09 13:43:13.379: W/System.err(25924): Slow frame!!! (14, g=10, w=4)
11-09 13:43:13.970: W/System.err(25924): Slow frame!!! (14, g=11, w=3)
11-09 13:43:14.410: W/System.err(25924): Avg draw time: 4
11-09 13:43:15.061: W/System.err(25924): Slow frame!!! (12, g=9, w=2)
11-09 13:43:15.081: W/System.err(25924): Slow frame!!! (13, g=3, w=10)
11-09 13:43:15.111: W/System.err(25924): Slow frame!!! (23, g=16, w=6)
11-09 13:43:15.461: W/System.err(25924): Avg draw time: 5
11-09 13:43:16.142: W/System.err(25924): Slow frame!!! (18, g=3, w=15)
11-09 13:43:16.162: W/System.err(25924): Slow frame!!! (14, g=11, w=3)
11-09 13:43:16.482: W/System.err(25924): Avg draw time: 5
11-09 13:43:17.223: W/System.err(25924): Slow frame!!! (17, g=14, w=3)
11-09 13:43:17.243: W/System.err(25924): Slow frame!!! (15, g=4, w=11)
11-09 13:43:17.503: W/System.err(25924): Avg draw time: 5
11-09 13:43:18.054: W/System.err(25924): Slow frame!!! (17, g=9, w=8)
4

0 回答 0