Jump to content
  • Advertisement
Sign in to follow this  
lancemao

VBO no performance boost at all

This topic is 1941 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

 

Share this post


Link to post
Share on other sites
Advertisement

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)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!