Jump to content

  • Log In with Google      Sign In   
  • Create Account


VBO no performance boost at all


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 lancemao   Members   -  Reputation: 106

Like
0Likes
Like

Posted 01 June 2013 - 01:28 AM

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

 



Sponsor:

#2 C0lumbo   Crossbones+   -  Reputation: 2101

Like
0Likes
Like

Posted 01 June 2013 - 03:51 AM

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)



#3 radioteeth   Prime Members   -  Reputation: 905

Like
0Likes
Like

Posted 01 June 2013 - 11:48 AM

What's your code look like that calls glDrawArrays ?



#4 lancemao   Members   -  Reputation: 106

Like
0Likes
Like

Posted 01 June 2013 - 08:02 PM

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






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS