Skip to main content
GameDev.net gamedev.net
🔒 Locked

VBO no performance boost at all

Started by lancemao Jun 1, 2013 at 7:28 AM 2 replies 2k views
Original Post
lancemao
lancemao

Hi Guru,

I implemented VBO. However, after testing, I found no performance boost at all. I tested on Latest Samsung Android phones like S4, iPhone4S, iPad4, and iOS emulator (although I read from internet that emulator might not benefit from VBO)

Here is my code

GLuint name[1];
glGenBuffers(1, name);
GLuint vboHandle = name[0];
vertexBuffer->setPositionHandle(vboHandle);
glBindBuffer(GL_ARRAY_BUFFER, vboHandle);
glBufferData(GL_ARRAY_BUFFER,
vertexBuffer->getPositionLength() * sizeof(float),
vertexBuffer->getPosition(), GL_STATIC_DRAW);
and set pointer as follow:
if (isBound)
{
glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer->getPositionHandle());
}
glVertexAttribPointer(vPositionHandle, vertexComponentSize, GL_FLOAT, GL_FALSE, 0, isBound ? 0 : vertexBuffer->getPosition());
I confirm these functions are called. And when I disable VBO, I will end up setting pointer every frame. But there is no performance boost
Any Idea is highly appreciated, thanks!
-Lance
C0lumbo
C0lumbo

How were you measuring the impact of your optimisation?

An optimisation like this can be expected to give a speedup on the CPU by requiring less work to be done in constructing the command buffer, and a speedup on the GPU by requiring less work in consuming the command buffer and fetching the vertices.

However, this may not be reflected in your frame rate if your frame rate is currently being limited by some other factor. For example, the fill-rate (that is, the per pixel processing on the GPU), may be so large relative to everything else that it is the single factor that is currently limiting your frame rate. The platforms you mention are often fill-rate bound as they tend to have a lot of pixels relative to their GPU power.

A quick and dirty test to see if you are fill rate bound is to setup a scissor rectangle so that only a tiny square of pixels are drawn. If you want to investigate further then Apple have reasonable profiling tools (renderer utilization is the main indicator of whether you're fill rate bound - here's a relevant link http://stackoverflow.com/questions/4511241/by-what-is-my-ios-opengl-es-2-0-apps-performance-bound)

deftware
deftware

What's your code look like that calls glDrawArrays ?

[ deftware.org ]
lancemao
lancemao

apology for missing info

so I use one single call to test. I simply increase the number of vertex so that it cannot reach 60 fps on either platform, as they will vsync on 60 FPS. but with/out VBO, i got exactly same fps

glDrawArrays(GL_POINTS, 0, elementCount);

in order to make sure vertex data copying is happening many times, I modified my program so that I call multiple glDrawArray instead of one. I assume without VBO, whenever glDrawArray (or glDrawElement) is called, GPU will firstly copy vertex data into command queue and later copy again to GPU, whereas for VBO, it will copy only once. Unfortunately, I still got exactly same fps

BTW, you can find full source code here:

http://code.google.com/p/openmobile3d/

thanks for your time and effort

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.