gpt4 book ai didi

iphone - 当前渲染缓冲区 : GL_RENDERBUFFER_OES takes long time

转载 作者:行者123 更新时间:2023-12-03 19:45:16 28 4
gpt4 key购买 nike

我在游戏中添加了一个分析器并隔离了此功能。有时,它会导致 FPS 下降。这是我的结果:

Present buffer time: 22
Present buffer time: 1
Present buffer time: 9
Present buffer time: 1
Present buffer time: 20
Present buffer time: 6
Present buffer time: 4
Present buffer time: 4
Present buffer time: 22
Present buffer time: 4
Present buffer time: 8
Present buffer time: 4
Present buffer time: 4
Present buffer time: 15
Present buffer time: 1
Present buffer time: 1
Present buffer time: 1
Present buffer time: 11
Present buffer time: 1
Present buffer time: 6
Present buffer time: 1
Present buffer time: 1
Present buffer time: 25
Present buffer time: 6
Present buffer time: 7
Present buffer time: 1
Present buffer time: 10
Present buffer time: 7
Present buffer time: 3
Present buffer time: 1
Present buffer time: 12
Present buffer time: 9
Present buffer time: 6
Present buffer time: 9

你知道为什么每隔几帧这个函数就需要更多的时间吗?

这是我的代码:


f64 time = -System::GetTime();
[m_context presentRenderbuffer:GL_RENDERBUFFER_OES];
Log("Present buffer time: %d\n", u32((System::GetTime() + time) * 1000.));

最佳答案

如果您没有显式调用 glFlush(),驱动程序将在您呈现缓冲区时强制执行此操作,因为在 presentRenderbuffer 时调用渲染操作缓冲区上的操作可能尚未完成。

在显示缓冲区并单独测量其时间之前,尝试调用 glFlush

关于iphone - 当前渲染缓冲区 : GL_RENDERBUFFER_OES takes long time,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5134488/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com