为什么CGLFlushDrawable这么慢? (我正在使用VBO) [英] Why is CGLFlushDrawable so slow? (I am using VBOs)

查看:140
本文介绍了为什么CGLFlushDrawable这么慢? (我正在使用VBO)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序详细信息:

运行于:具有4GB RAM的Macbook pro,具有128MB VRAM的ATI Radeon X1600,Opengl版本:2.1 ATI -7.0.52

Running on : Macbook pro with 4GB RAM, ATI Radeon X1600 with 128MB VRAM, Opengl version: 2.1 ATI-7.0.52

使用垂直同步(通过CVDisplay):是

Using vertical sync (via CVDisplay) : YES

编程语言:Lisp(Lispworks)使用FFI到Opengl

Programming Language: Lisp (Lispworks) with FFI to Opengl

像素格式信息


  • ns-open-gl-pfa-depth-size 32

  • ns-open-gl-pfa-sample-buffers 1

  • ns-open -gl-pfa-samples 6

  • ns-open-gl-pfa-accelerated 1

  • ns-open-gl-pfa-no-recovery 1

  • ns-open-gl-pfa-backing-store 0

  • ns-open-gl-pfa-virtual-screen-count 1

  • ns-open-gl-pfa-depth-size 32
  • ns-open-gl-pfa-sample-buffers 1
  • ns-open-gl-pfa-samples 6
  • ns-open-gl-pfa-accelerated 1
  • ns-open-gl-pfa-no-recovery 1
  • ns-open-gl-pfa-backing-store 0
  • ns-open-gl-pfa-virtual-screen-count 1

[1 =是,0 =否]布尔值属性

我的应用程序中有以下网格物体:

14个静态网格物体(不变)。我为每个具有静态绘制类型的网格定义了一个VBO。

14 static meshes (which do not change). I have defined a VBO for each mesh with static draw type.

2个动态网格物体(每帧变化)。我为每个具有流绘制类型的网格定义了一个VBO。

2 dynamic meshes (which change per frame). I have defined a VBO for each mesh with stream draw type.

对于这些动态网格,每帧我用空指针执行一个绑定缓冲区数据,然后映射缓冲区,更新映射缓冲区并取消映射缓冲区。

For these dynamic meshes, per frame I do a bind buffer data with null pointer, then map buffer, update the mapped buffer and unmap the buffer.

当我运行应用程序并使用Opengl分析器检查时:它显示以下内容(统计视图):

When I run the app and check with Opengl profiler: it shows the following (Statistics View) for:

CGLFlushDrawable :


  • 平均时间(以微秒为单位): 52990.63 = 52.990 ms

  • %总帐时间: 98.55

  • %应用时间: 43.96

  • Average Time (in micro sec): 52990.63 = 52.990 ms
  • % GL Time: 98.55
  • % App Time: 43.96

难怪我得到的FPS非常差,约为6-7 FPS。

No wonder I get a very poor FPS of around 6-7 FPS.

如何实现优化CGLFlushDrawable,因为我只是调用flushBuffer,而我相信依次调用CGLFlushBuffer。

What is the way to optimize CGLFlushDrawable, since I just invoke flushBuffer which in turn invokes CGLFlushBuffer I believe.

推荐答案

嗯,事实证明 我的ATI Radeon X1600显卡有问题

Well, it turns out that there is a problem with my ATI Radeon X1600 graphics card.

当我在另一块上测试相同的代码时,没有任何更改具有Intel HD Graphics 30的更新的13英寸Macbook Pro 00,带有384MB DDR3 SDRAM,在
大约30 FPS的情况下,该应用程序可以正常运行,这是我所期望的,考虑到我拥有的动态网格。

Without any change, when I test the same code on another newer 13" Macbook Pro which has an Intel HD Graphics 3000 with 384MB of DDR3 SDRAM, the application works fine with around 30 FPS which is what I expect, given the dynamic meshes that I have.

CGLFlushDrawable 中没有任何瓶颈,就像我以前的
MBP一样。此外,在VBO分配后,VRAM中可用的内存量保持不变
(再次是我所期望的)。

Also, there is no bottleneck whatsoever in CGLFlushDrawable as was the case on my old MBP. Further the amount of memory in VRAM available after VBO allocation remains the same (again what I was expecting). This is not what was happening on my old MBP.

最后,我的MBP显示器崩溃了(虽然不够频繁),并且外接LCD显示器也无法正常工作,

And finally, my MBP display has crashed (not regularly enough though) and external LCD display also does not work fine, which points to problems with my graphics card.

@Brad,谢谢您的所有输入。

@Brad, thanks for all your inputs.

这篇关于为什么CGLFlushDrawable这么慢? (我正在使用VBO)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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