纹理缓存统计信息不足时,出现Opengl错误0x505 [英] Got Opengl error 0x505 while texture cache statistic is low

查看:79
本文介绍了纹理缓存统计信息不足时,出现Opengl错误0x505的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用cocos2dx 2.2 + lua开发一款Android游戏.在测试时,我从logcat得到了很多"opengl错误0x505".根据opengl doc,这意味着内存不足".因此,我每3秒使用以下命令打印一次纹理缓存cocos2d :: CCTextureCache :: sharedTextureCache()-> dumpCachedTextureInfo();dumpCachedTextureInfo()的输出显示最高的纹理缓存为70M,但没有发生错误0x505".缓存不足时显示``错误0x505'',例如约35M.我的问题是,opengl显示内存和cocos2dx纹理缓存内存不一样吗?在纹理缓存未达到最高点时如何出现错误0x505"?期待您的回答或建议.谢谢.

I am developing an android game using cocos2dx 2.2 + lua. While testing,I got a lot of 'opengl error 0x505' from logcat. According to opengl doc, this means 'out of memory'. Hence, I print out texture cache every 3 seconds using cocos2d::CCTextureCache::sharedTextureCache()->dumpCachedTextureInfo(); The output of dumpCachedTextureInfo() shows that the highest texture cache is 70M, but no 'error 0x505' occurs. 'error 0x505' come out while the cache is low, e.g. ~35M. My question is, isn't opengl display memory and cocos2dx texture cache memory the same thing? How can 'error 0x505' occur while texture cache is not at its highest point?Looking forward to your answer or suggestion.Thanks.

推荐答案

在某些低端设备上,我们的游戏(运行Cocos2d-x 3.3)遇到了相同的错误,还出现了一些时髦的渲染问题.在我们的案例中,原因是自定义的OpenGL片段着色器,它在代码方面太大,并且减小了该问题的大小.

I got the same error with our game (running Cocos2d-x 3.3) on some low end devices, along with some funky rendering problems. The cause in our case was a custom OpenGL fragment shader which was too big in terms of code, and reducing the size of that fixed the issue.

总的来说,错误来自OpenGL的事实向我表明问题出在GPU内存而不是RAM.而且,据我所知,由于CCTextureCache仅占用RAM,因此我认为问题与此无关.

On a general note, the fact that the error comes from OpenGL suggests to me that the problem is GPU memory rather than RAM. And since CCTextureCache (to my knowledge) only occupies RAM, I'm guessing the problem is unrelated to that.

这篇关于纹理缓存统计信息不足时,出现Opengl错误0x505的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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