eglSwapBuffers飘忽不定/慢 [英] eglSwapBuffers is erratic/slow

查看:3897
本文介绍了eglSwapBuffers飘忽不定/慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有非常低的渲染时间使用NDK和EGL命令的Andr​​oid平板电脑的一个问题。我已超时调用 eglSwapBuffers 并正在采取可变的时间量,常常超过了设备的帧速率。我知道它同步到刷新,但毕竟是60FPS左右,这里的时间下降,远低于这一点。

I have a problem with very low rendering time on an android tablet using the NDK and the egl commands. I have timed calls to eglSwapBuffers and is taking a variable amount of time, frequently exceeded the device frame rate. I know it synchronizes to the refresh, but that is around 60FPS, and the times here drop well below that.

我就调用交换之间的唯一命令是 glClear ,所以我知道这不是什么,我画造成问题的原因。即使只是帧速率下降结算到30FPS(但不稳定)。

The only command I issue between calls to swap is glClear, so I know it isn't anything that I'm drawing causing the problem. Even just by clearing the frame rate drops to 30FPS (erratic though).

在同一台设备中的Java简单的GL程序轻松地呈现在60FPS,所以我知道这是没有从根本上硬件问题。我已经通过Android的Java code寻找建立GL上下文并不能看到任何显著差异。我也玩过每一个配置属性,而一些改变速度略,无(即我能找到)改变这种可怕的帧率下降。

On the same device a simple GL program in Java easily renders at 60FPS, thus I know it isn't fundamentally a hardware issue. I've looked through the Android Java code for setting up the GL context and can't see any significant difference. I've also played with every config attribute, and while some alter the speed slightly, none (that I can find) change this horrible frame rate drop.

要确保的情况下投票是不是一个问题,我搬到渲染成线。这线程现在不仅渲染,从而也就要求明确和交换反复。性能下降依然存在。

To ensure the event polling wasn't an issue I moved the rendering into a thread. That thread now only does rendering, thus just calls clear and swap repeatedly. The slow performance still persists.

我的想法是什么检查,我期待的建议,以什么样的问题可能是。

I'm out of ideas what to check and am looking for suggestions as to what the problem might be.

推荐答案

还有的实在没有足够的信息(像什么设备,你正在测试的,什么是你确切的配置等)来回答这个100%可靠的,但这种行为是通常由窗口和表面的像素格式不匹配,如引起的。 16位(RGB565)与32位。

There's really not enough info (like what device you are testing on, what was you exact config etc) to answer this 100% reliable but this kind of behavior is usually caused by window and surface pixel format mismatch eg. 16bit (RGB565) vs 32bit.

这篇关于eglSwapBuffers飘忽不定/慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆