问题
My application details:
Running on : Macbook pro with 4GB RAM, ATI Radeon X1600 with 128MB VRAM, Opengl version: 2.1 ATI-7.0.52
Using vertical sync (via CVDisplay) : YES
Programming Language: Lisp (Lispworks) with FFI to Opengl
Pixel Format information
- 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 = YES, 0 = NO] for boolean attribs
I have in my application the following meshes:
14 static meshes (which do not change). I have defined a VBO for each mesh with static draw type.
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.
When I run the app and check with Opengl profiler: it shows the following (Statistics View) for:
CGLFlushDrawable:
- Average Time (in micro sec): 52990.63 = 52.990 ms
- % GL Time: 98.55
- % App Time: 43.96
No wonder I get a very poor FPS of around 6-7 FPS.
What is the way to optimize CGLFlushDrawable, since I just invoke flushBuffer which in turn invokes CGLFlushBuffer I believe.
回答1:
Well, it turns out that there is a problem with my ATI Radeon X1600 graphics card.
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.
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.
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, thanks for all your inputs.
来源:https://stackoverflow.com/questions/10507190/why-is-cglflushdrawable-so-slow-i-am-using-vbos